refactor(semantic): change Bindings to a plain FxHashMap#8019
Merged
graphite-app[bot] merged 1 commit intomainfrom Dec 19, 2024
Merged
Conversation
Member
Author
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Member
|
Maybe, that's the reason why without any tests failed in my attempt |
CodSpeed Performance ReportMerging #8019 will improve performances by 3.77%Comparing Summary
Benchmarks breakdown
|
566aa1c to
5fddbb9
Compare
Member
Author
Merge activity
|
`IndexMap` was needed for the insertion order requirement in mangler. Bindings (symbol ids) are monotonically increasing by binding positions, which means we can get insertion order by sorting the symbol ids in mangler. Previous attempt: #4228
5fddbb9 to
02f968d
Compare
Boshen
pushed a commit
that referenced
this pull request
Dec 20, 2024
…rst (#8020) #8019 changed scope bindings from an ordered `IndexMap` to an unordered `FxHashMap`. `ScopeTree::rename_binding` no longer needs to preserve order, so can remove the old binding before adding the new one. This makes it less likely that the hash map will need to reallocate. Also remove comments about preserving ordering of bindings, which are now outdated.
Boshen
pushed a commit
that referenced
this pull request
Dec 20, 2024
…rst (#8020) #8019 changed scope bindings from an ordered `IndexMap` to an unordered `FxHashMap`. `ScopeTree::rename_binding` no longer needs to preserve order, so can remove the old binding before adding the new one. This makes it less likely that the hash map will need to reallocate. Also remove comments about preserving ordering of bindings, which are now outdated.
Boshen
pushed a commit
that referenced
this pull request
Dec 20, 2024
…rst (#8020) #8019 changed scope bindings from an ordered `IndexMap` to an unordered `FxHashMap`. `ScopeTree::rename_binding` no longer needs to preserve order, so can remove the old binding before adding the new one. This makes it less likely that the hash map will need to reallocate. Also remove comments about preserving ordering of bindings, which are now outdated.
Boshen
added a commit
that referenced
this pull request
Dec 21, 2024
## [0.43.0] - 2024-12-21 - de4c772 traverse: [**BREAKING**] Rename `Ancestor::is_via_*` methods to `is_parent_of_*` (#8031) (overlookmotel) - ed75e42 semantic: [**BREAKING**] Make SymbolTable fields `pub(crate)` instead of `pub` (#7999) (Boshen) ### Features - 75b775c allocator: `Vec<u8>::into_string` (#8017) (overlookmotel) - 8547e02 ast: Implement `allocator_api2` for `Allocator` (#8043) (Boshen) - 63a95e4 ast: Add `AstBulder::move_property_key` (#7998) (overlookmotel) - 897a1a8 transformer/class-properties: Exit faster from super replacement visitor (#8028) (overlookmotel) - 3ea4109 transformer/class-properties: Transform super update expressions within static prop initializer (#7997) (Dunqing) - cc57db3 transformer/class-properties: Transform super assignment expressions within static prop initializer (#7991) (Dunqing) - 6b6444b traverse: Record current block scope (#8007) (overlookmotel) ### Bug Fixes - 043252d transformer/class-properties: Replace `this` and class name in static blocks (#8035) (overlookmotel) - 273795d transformer/class-properties: Run other transforms on static properties, static blocks, and computed keys (#7982) (overlookmotel) ### Performance - c0dd3f8 ast: `move_expression` and `move_statement` produce dummy with no span (#7995) (overlookmotel) - 862838f codegen: Remove useless to_owned (#8014) (Dunqing) - 2736657 semantic: Allocate `UnresolvedReferences` in allocator (#8046) (Boshen) - 2e8872c semantic: Allocate child scope in allocator (#8045) (Boshen) - 414e828 semantic: Allocate symbol data in Allocator (#8012) (Boshen) - 7aebed0 semantic: Allocate `Bindings` in allocator (#8021) (Boshen) - 0f9308f transformer/react-refresh: Reduce allocations (#8018) (overlookmotel) - 0deb9e6 transformer/react-refresh: Reserve capacity in hook key string (#8016) (overlookmotel) - 7b70347 transformer/react-refresh: Avoid allocating string in each hook call (#8013) (Dunqing) ### Documentation - df5c341 ast: Improve docs for `AstBuilder::move_*` methods (#7994) (overlookmotel) ### Refactor - f1adf9f semantic: `ScopeTree::rename_binding` remove old binding first (#8020) (overlookmotel) - 02f968d semantic: Change `Bindings` to a plain `FxHashMap` (#8019) (Boshen) - e7476a1 semantic: Remove `serialize` (#8015) (Boshen) - 1cf7b83 semantic: Simplify handling namespace stack (#7987) (Dunqing) - 48cb52b semantic: Remove resetting `current_reference_flags` in visit functions (#7986) (Dunqing) - 3250a47 semantic: Remove unused current_symbol_flags (#7985) (Dunqing) - efe96ec semantic: Use `Stack` for function stack node ids (#7984) (Dunqing) - ac097e9 transformer/class-properties: Rename file (#8036) (overlookmotel) - 059a5dd transformer/class-properties: Do not pass `ScopeId` into `insert_instance_inits` (#8001) (overlookmotel) - 0a38eea transformer/class-properties: Use `temp_var_name_base` to generate temp var names for `super` transform (#8004) (overlookmotel) - d1b7181 transformer/class-properties: Rename var (#8006) (overlookmotel) - 5a23d72 transformer/class-properties: Remove outdated comment (#8000) (overlookmotel) - b3a5f3e transformer/class-properties: Mark `transform_assignment_expression_if_super_member_assignment_target` as inline (#7993) (Dunqing) ### Testing - bcb33c0 semantic: Add a test for catch parameters reference (#7988) (Dunqing) Co-authored-by: Boshen <[email protected]>
Boshen
added a commit
that referenced
this pull request
Dec 30, 2024
## [0.15.4] - 2024-12-30 ### Features - 47cea9a linter: Implement `eslint/no-extra-label` (#8181) (Anson Heung) - ef76e28 linter: Implement `eslint/no-multi-assign` (#8158) (Anson Heung) - 384858b linter: Implement `jsx-a11y/no-noninteractive-tabindex` (#8167) (Tyler Earls) - afc21a6 linter: Implement `eslint/vars-on-top` (#8157) (Yuichiro Yamashita) - 65796c4 linter: Implement `eslint/prefer-rest-params` (#8155) (Yuichiro Yamashita) - 5234d96 linter: Implement `eslint/no-nested-ternary` (#8150) (Yuichiro Yamashita) - 1c5db72 linter: Implement eslint/no-labels (#8131) (Anson Heung) - 0b04288 linter: Move `import/named` to nursery (#8068) (Boshen) ### Bug Fixes - 0794bee editor/vscode: Set minimum supported ver. to `^1.93.0` (#8182) (Pavel Smirnov) - f3050d4 linter: Exclude svelte files from `no_unused_vars` rule (#8170) (Yuichiro Yamashita) - faf7464 linter: Disable rule `react/rules-of-hook` by file extension (#8168) (Alexander S.) - 1171e00 linter: Disable `react/rules-of-hooks` for vue and svelte files (#8165) (Alexander S.) - 1b9a5ba linter: False positiver in private member expr in oxc/const-comparison (#8164) (camc314) - 6bd9ddb linter: False positive in `typescript/ban-tslint-comment` (#8094) (dalaoshu) - 10a1fd5 linter: Rule: `no-restricted-imports` support option `patterns` with `group` key (#8050) (Alexander S.) - b3f38ae linter: Rule `no-restricted-imports`: support option `allowImportNames` (#8002) (Alexander S.) - 340cc90 linter: Rule `no-restricted-imports`: fix option "importNames" (#7943) (Alexander S.) - ec2128e linter: Fix line calculation for `eslint/max-lines` in diagnostics (#7962) (Dmitry Zakharov) - 79af100 semantic: Reference flags not correctly resolved when after an export stmt (#8134) (camc314) ### Performance - d8d2ec6 linter: Run rules which require typescript syntax only when source type is actually typescript (#8166) (Alexander S.) - 2736657 semantic: Allocate `UnresolvedReferences` in allocator (#8046) (Boshen) ### Refactor - de8246b language_server: Move structs into own file (#8026) (Alexander S.) - 774babb linter: Read `exported_bindings_from_star_export` lazily (#8062) (Boshen) - 547c102 linter: Use `RwLock<FxHashMap>` instead of `FxDashMap` for module record data (#8061) (Boshen) - 952d7e4 linter: Rename `flat.rs` to `config.rs` (#8033) (camc314) - 50848ed linter: Simplify `ConfigStore` to prep for nested configs (#8032) (camc314) - b2a4a78 linter: Remove unused `with_rules` and `set_rule` methods (#8029) (camc314) - 6da0b21 oxlint: Remove unused `git.rs` (#7990) (Boshen) - 58e7777 oxlint: Remove extra if check in `Walkdir` (#7989) (Boshen) - 02f968d semantic: Change `Bindings` to a plain `FxHashMap` (#8019) (Boshen) Co-authored-by: Boshen <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

IndexMapwas needed for the insertion order requirement in mangler.Bindings (symbol ids) are monotonically increasing by binding
positions, which means we can get insertion order by sorting the symbol ids in
mangler.
Previous attempt: #4228