Skip to content

Comments

refactor(isolated-declarations): reorganize scope tree#4070

Merged
Dunqing merged 1 commit intooxc-project:mainfrom
lucab:ups/isolated-decl-scopes
Jul 6, 2024
Merged

refactor(isolated-declarations): reorganize scope tree#4070
Dunqing merged 1 commit intooxc-project:mainfrom
lucab:ups/isolated-decl-scopes

Conversation

@lucab
Copy link
Contributor

@lucab lucab commented Jul 6, 2024

This reorganizes scope fields into levels which atomically follow the enter/leave pattern. It avoids tracking the same lenght and capacity separately for each property, and does not need to grow multiple vectors while traversing.

This reorganizes scope fields into levels which atomically follow
the enter/leave pattern. It avoids tracking the same lenght and
capacity separately for each property, and does not need to grow
multiple vectors while traversing.
@graphite-app
Copy link
Contributor

graphite-app bot commented Jul 6, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added the A-isolated-declarations Isolated Declarations label Jul 6, 2024
@codspeed-hq
Copy link

codspeed-hq bot commented Jul 6, 2024

CodSpeed Performance Report

Merging #4070 will not alter performance

Comparing lucab:ups/isolated-decl-scopes (49090b0) with main (aa45604)

Summary

✅ 28 untouched benchmarks

Copy link
Member

@Dunqing Dunqing left a comment

Choose a reason for hiding this comment

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

Great work. Thank you!

@Dunqing Dunqing merged commit 65aee19 into oxc-project:main Jul 6, 2024
@lucab lucab deleted the ups/isolated-decl-scopes branch July 6, 2024 15:01
@github-actions github-actions bot mentioned this pull request Jul 6, 2024
Boshen added a commit that referenced this pull request Jul 6, 2024
## [0.17.1] - 2024-07-06

### Bug Fixes

- aa585d3 ast_codegen, ast: Visit `ExpressionArrayElement` as
`Expression`. (#4061) (rzvxa)
- 564a75a codegen: Missing TypeParameters in TSConstructSignature
(#4063) (michaelm)
- adee728 isolated_declarations: Don't report an error for parameters if
they are ObjectPattern or ArrayPattern with an explicit type (#4065)
(michaelm)
- 1b8f208 isolated_declarations: Correct emit for private static methods
(#4064) (michaelm)
- 719fb96 minifier: Omit dce `undefined` which can be a shadowed
variable (#4073) (Boshen)
- 150f4d9 napi/transform: Display error with spanned messages (Boshen)

### Performance

- 7fe2a2f parser: Do not copy comments (#4067) (overlookmotel)

### Refactor

- 8fa98e0 ast: Inline trivial functions and shorten code (#4066)
(overlookmotel)
- 65aee19 isolated-declarations: Reorganize scope tree (#4070) (Luca
Bruno)

Co-authored-by: Boshen <[email protected]>
@overlookmotel
Copy link
Member

@lucab Just out of interest, did you see any performance change from this PR? I think it was before we added a benchmark on CodSpeed for isolated-declarations. I'm looking at revamping Semantic, and would be interested to know whether this move from "struct of arrays" style to "array of structs" was good or bad for perf.

Dunqing added a commit that referenced this pull request Jul 8, 2024
@lucab
Copy link
Contributor Author

lucab commented Jul 8, 2024

@overlookmotel I didn't have good benchmarks to compare, but running some small examples through hyperfine and valgrind didn't show relevant changes in either directions. We can try reverting it (it seems @Dunqing may be doing that now) as see what was the real delta.

That said, here there was no consumer using the SoA to slice through a single field, but instead all Vecs were pushed/popped at the same time. Semantic may or may not have different access patterns to this one.

@Dunqing
Copy link
Member

Dunqing commented Jul 8, 2024

From the benchmark results, there is no difference in performance. However, this makes the code organization clearer.

@overlookmotel
Copy link
Member

OK cool. Thanks both for coming back. You're right lucab that Semantic may well have different access patterns, so a different approach may be appropriate there. But still interesting to know it made little difference in this case.

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

Labels

A-isolated-declarations Isolated Declarations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants