+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

refactor(rome_rowan): change mutation methods to return detached nodes #2949

Merged
merged 1 commit into from
Jul 28, 2022

Conversation

leops
Copy link
Contributor

@leops leops commented Jul 28, 2022

Summary

The splice_slots and replace_child methods in rome_rowan were initially implemented to rebuild the entire tree above the mutated node, but no code was actually relying on this outside of the implementation of replace_child itself. I've modified splice_slots and moved replace_child into the cursor API to return a new detached node instead of respining the entire tree, this greatly simplifies the algorithm since it doesn't need to rebuild the green tree above the current node and doesn't need to rebuild the red tree at all.

Test Plan

This change is internal to rowan, while it does change the semantics of splice_slots and replace_child no code relies on this specific behavior and all the tests for the analyzer should continue to pass

@leops leops requested a review from a team July 28, 2022 09:16
@leops leops temporarily deployed to aws July 28, 2022 09:16 Inactive
@github-actions
Copy link

@github-actions
Copy link

Parser conformance results on ubuntu-latest

js/262

Test result main count This PR count Difference
Total 45878 45878 0
Passed 44938 44938 0
Failed 940 940 0
Panics 0 0 0
Coverage 97.95% 97.95% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 39 39 0
Passed 36 36 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.31% 92.31% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 5946 5946 0
Passed 395 395 0
Failed 5551 5551 0
Panics 0 0 0
Coverage 6.64% 6.64% 0.00%

ts/babel

Test result main count This PR count Difference
Total 588 588 0
Passed 519 519 0
Failed 69 69 0
Panics 0 0 0
Coverage 88.27% 88.27% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 16257 16257 0
Passed 12393 12393 0
Failed 3864 3864 0
Panics 0 0 0
Coverage 76.23% 76.23% 0.00%

@leops
Copy link
Contributor Author

leops commented Jul 28, 2022

!bench_analyzer

@github-actions
Copy link

Analyzer Benchmark Results

group                     main                                   pr
-----                     ----                                   --
analyzer/css.js           1.12      2.7±0.02ms     4.4 MB/sec    1.00      2.4±0.01ms     4.9 MB/sec
analyzer/index.js         1.01      5.9±0.01ms     5.4 MB/sec    1.00      5.9±0.04ms     5.5 MB/sec
analyzer/lint.ts          1.00      3.7±0.01ms    11.4 MB/sec    1.00      3.6±0.01ms    11.4 MB/sec
analyzer/parser.ts        1.04      8.5±0.07ms     5.7 MB/sec    1.00      8.1±0.01ms     5.9 MB/sec
analyzer/router.ts        1.04      5.9±0.01ms    10.4 MB/sec    1.00      5.7±0.02ms    10.8 MB/sec
analyzer/statement.ts     1.00      7.6±0.02ms     4.6 MB/sec    1.00      7.6±0.05ms     4.7 MB/sec
analyzer/typescript.ts    1.00     11.2±0.04ms     4.9 MB/sec    1.00     11.1±0.02ms     4.9 MB/sec

@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 69107b5
Status: ✅  Deploy successful!
Preview URL: https://396bbec4.tools-8rn.pages.dev
Branch Preview URL: https://refactor-node-mutation-detac.tools-8rn.pages.dev

View logs

@leops leops merged commit 487f72e into main Jul 28, 2022
@leops leops deleted the refactor/node-mutation-detach branch July 28, 2022 12:24
IWANABETHATGUY pushed a commit to IWANABETHATGUY/tools that referenced this pull request Aug 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载