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

perf(formatter): Remove prev_token traversal from format leading trivia #2638

Merged
merged 1 commit into from
Jun 1, 2022

Conversation

MichaReiser
Copy link
Contributor

…ivia

The trailing trivia of the previous token can never contain a new line. Any new line is always part of the current tokens leading trivia, thus, this check is not necessary

Test Plan

cargo test

…ivia

The trailing trivia of the previous token can never contain a new line. Any new line is always part of the current tokens leading trivia, thus, this check is not necessary
@MichaReiser MichaReiser requested a review from leops June 1, 2022 10:42
@MichaReiser MichaReiser temporarily deployed to aws June 1, 2022 10:42 Inactive
@MichaReiser
Copy link
Contributor Author

!bench_formatter

@MichaReiser MichaReiser marked this pull request as ready for review June 1, 2022 10:42
@github-actions
Copy link

github-actions bot commented Jun 1, 2022

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 350 350 0
Failed 5591 5591 0
Panics 5 5 0
Coverage 5.89% 5.89% 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 12391 12391 0
Failed 3866 3866 0
Panics 0 0 0
Coverage 76.22% 76.22% 0.00%

@github-actions
Copy link

github-actions bot commented Jun 1, 2022

@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: da467ad
Status: ✅  Deploy successful!
Preview URL: https://8b033339.tools-8rn.pages.dev

View logs

@github-actions
Copy link

github-actions bot commented Jun 1, 2022

Formatter Benchmark Results

group                                    main                                   pr
-----                                    ----                                   --
formatter/checker.ts                     1.08    398.8±0.78ms     6.5 MB/sec    1.00    368.5±1.32ms     7.1 MB/sec
formatter/compiler.js                    1.10    243.3±1.03ms     4.3 MB/sec    1.00    221.6±0.72ms     4.7 MB/sec
formatter/d3.min.js                      1.08    184.8±0.50ms  1452.3 KB/sec    1.00    171.4±0.91ms  1566.3 KB/sec
formatter/dojo.js                        1.09     13.4±0.02ms     5.1 MB/sec    1.00     12.3±0.04ms     5.6 MB/sec
formatter/ios.d.ts                       1.11    305.1±0.77ms     6.1 MB/sec    1.00    275.0±1.03ms     6.8 MB/sec
formatter/jquery.min.js                  1.10     51.0±0.21ms  1658.2 KB/sec    1.00     46.3±0.15ms  1827.3 KB/sec
formatter/math.js                        1.08    378.8±0.89ms  1750.2 KB/sec    1.00    349.8±0.86ms  1895.3 KB/sec
formatter/parser.ts                      1.10      9.3±0.05ms     5.2 MB/sec    1.00      8.5±0.01ms     5.7 MB/sec
formatter/pixi.min.js                    1.08    211.1±0.47ms     2.1 MB/sec    1.00    195.9±0.87ms     2.2 MB/sec
formatter/react-dom.production.min.js    1.11     63.7±0.32ms  1848.9 KB/sec    1.00     57.6±0.36ms  2046.7 KB/sec
formatter/react.production.min.js        1.11      3.1±0.00ms  2000.7 KB/sec    1.00      2.8±0.01ms     2.2 MB/sec
formatter/router.ts                      1.10      6.9±0.01ms     8.8 MB/sec    1.00      6.3±0.01ms     9.7 MB/sec
formatter/tex-chtml-full.js              1.08    481.4±0.83ms  1938.2 KB/sec    1.00    444.4±1.53ms     2.1 MB/sec
formatter/three.min.js                   1.08    242.0±0.45ms     2.4 MB/sec    1.00    223.7±0.70ms     2.6 MB/sec
formatter/typescript.js                  1.09   1529.1±2.97ms     6.2 MB/sec    1.00   1404.8±3.04ms     6.8 MB/sec
formatter/vue.global.prod.js             1.11     84.1±0.66ms  1467.7 KB/sec    1.00     75.9±0.57ms  1624.9 KB/sec

@MichaReiser MichaReiser merged commit 4e6f35f into main Jun 1, 2022
@MichaReiser MichaReiser deleted the perf/format-leading-trivia branch June 1, 2022 12:51
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.

2 participants