-
-
Notifications
You must be signed in to change notification settings - Fork 373
perf(shared/codegen-core): few small performance improvements #3917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
28db76f
perf(shared): simplify object iteration
SukkaW 4943cd2
perf(shared): hoist ir pattern regexps
SukkaW ec0928f
perf(shared): avoid iterators in `parseEnum`
SukkaW 29b7d15
perf(shared): fast path for is top level check
SukkaW 0353bd5
perf(codegen-core): replace copy via spread w/ inline recursive
SukkaW 846bf59
perf(shared): fast path for `additionalProperties` only object
SukkaW bd39845
perf(shared): avoid `Set` allocation when possible
SukkaW a6b13e3
perf(shared): fast path for hot path `jsonPointerToPath`
SukkaW 538b856
perf(shared): avoid delete and spread
SukkaW 3555252
perf(shared): prefer in-place mutate when possible
SukkaW 1dc3fa3
perf(shared): avoid object allocation
SukkaW b72029f
Merge branch 'main' into more-performance-improvement
mrlubos ec2bdba
docs: add changesets
mrlubos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@hey-api/codegen-core": patch | ||
| --- | ||
|
|
||
| **symbols**: fix: prefer recursive over top-level merging in registry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@hey-api/shared": patch | ||
| --- | ||
|
|
||
| **fix**: various performance improvements |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same aliasing concern: 2.0.x's
parseTypealso doesirSchema.required = schema.requiredwithout copying (see line 251 of this file), soirCompositionSchema.requiredcan alias the source spec. Thispushwill mutate the input document..concat(...)would preserve the perf intent while keeping the array fresh.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, this is OK, we don't use original
requiredanywhere else but to turn them intoirSchema.required. Also, the unit test says passed, so I expected this to be fine.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same context as the 3.1.x thread — the residual concern is a single
$ref'd component used from multipleallOfparents, where the first push pollutes the spec node read by the second. Not blocking; deferring to you since tests pass.Claude Opus| 𝕏