Skip to content

Stream workspace metadata JSON serialization - #575

Closed
zaniebot wants to merge 1 commit into
mainfrom
zb/workspace-metadata-stream-json
Closed

zaniebot wants to merge 1 commit into
mainfrom
zb/workspace-metadata-stream-json

Conversation

@zaniebot

@zaniebot zaniebot commented Aug 6, 2026 •

Copy link
Copy Markdown
Collaborator

uv workspace metadata currently serializes the entire pretty-printed response into a String before writing it, adding a full-response allocation for large workspaces. Serialize directly into a buffered, locked standard-output stream instead, while preserving the existing JSON formatting and output suppression behavior.

On Namespace, I measured uv workspace metadata --offline --frozen with optimized profiling builds and stdout redirected to /dev/null. Each version was measured in 41 interleaved rounds after warmups. Values are means; changes are relative to main, with paired-bootstrap 95% confidence intervals from 20,000 resamples.

Wall time (ms):

Workspace Packages JSON main This change Change (95% CI)
Small: uv 77 0.46 MB 30.82 29.02 −5.8% [−15.7%, +4.6%]
Medium: Prefect 363 2.01 MB 40.05 38.87 −3.0% [−11.5%, +6.5%]
Large: synthetic 6,346 20.53 MB 313.10 300.21 −4.1% [−7.2%, +0.5%]
Large: synthetic + environment 6,346 26.80 MB 425.68 403.18 −5.3% [−6.3%, −4.2%]

Peak RSS (MiB):

Workspace main This change Change (95% CI)
Small: uv 34.67 34.50 −0.5% [−1.4%, +0.4%]
Medium: Prefect 43.55 41.66 −4.3% [−5.2%, −3.6%]
Large: synthetic 150.64 115.38 −23.4% [−23.8%, −23.0%]
Large: synthetic + environment 164.83 132.34 −19.7% [−19.9%, −19.5%]

The small and medium cases use real public uv and Prefect lockfiles. The synthetic workspace has 4,864 members, 10,242 resolution nodes, and 79,264 dependency edges.

@astral-automations-bot astral-automations-bot Bot added performance preview Experimental behavior labels Aug 6, 2026
@zaniebot
zaniebot force-pushed the zb/workspace-metadata-stream-json branch from df67508 to bd4f893 Compare August 6, 2026 13:52
@zanieb
zanieb marked this pull request as ready for review August 6, 2026 14:32
@astral-automations-bot

Copy link
Copy Markdown

Promoted to #20990.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance preview Experimental behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants