Skip to content

progenitor-macro: read the OpenAPI document in one call - #1454

Merged
sunshowers merged 1 commit into
mainfrom
jj-stack/progenitor-macro-read-the-spec-file-in-one-call-psnoxsvq
Nov 16, 2026
Merged

sunshowers merged 1 commit into
mainfrom
jj-stack/progenitor-macro-read-the-spec-file-in-one-call-psnoxsvq

Conversation

@sunshowers

@sunshowers sunshowers commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

serde_json::from_reader reads files one byte at a time. In general the rule of thumb is that files of 20 MB or less should be read entirely into memory.

Noticed this while doing an omicron build profile.

serde_json::from_reader reads files one byte at a time. In general the rule of thumb is that files of 20 MB or less should be read entirely into memory.
@sunshowers sunshowers changed the title progenitor-macro: read the spec file in one call progenitor-macro: read the OpenAPI document in one call Nov 16, 2026

@ahl ahl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool; is there a measurable performance difference?

@sunshowers

sunshowers commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

measured against the current external API:

┌─────────┬─────────┬─────────────────────────┬──────────────────┐
│  Host   │  Build  │ Old (from_reader(File)) │ New (from_slice) │
├─────────┼─────────┼─────────────────────────┼──────────────────┤
│ Linux   │ debug   │ 500.7 ms                │ 28.4 ms          │
├─────────┼─────────┼─────────────────────────┼──────────────────┤
│ Linux   │ release │ 432.0 ms                │ 4.9 ms           │
├─────────┼─────────┼─────────────────────────┼──────────────────┤
│ illumos │ debug   │ 1328.2 ms               │ 30.7 ms          │
├─────────┼─────────┼─────────────────────────┼──────────────────┤
│ illumos │ release │ 1186.0 ms               │ 5.3 ms           │
└─────────┴─────────┴─────────────────────────┴──────────────────┘

It's, uh, massive.

@sunshowers
sunshowers merged commit ed7c22e into main Nov 16, 2026
13 checks passed
@sunshowers
sunshowers deleted the jj-stack/progenitor-macro-read-the-spec-file-in-one-call-psnoxsvq branch November 16, 2026 20:05
ahl pushed a commit that referenced this pull request Nov 18, 2026
serde_json::from_reader reads files one byte at a time. In general the rule of thumb is that files of 20 MB or less should be read entirely into memory.
ahl added a commit that referenced this pull request Nov 18, 2026
main's commits since the 0.16.0 release are already on v0_next: the
0.16.1 release and #1452 through the #1455 sync, and #1451, #1454 and
#1456 as cherry-picks. This merge records that and keeps v0_next's tree
unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants