Skip to content
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

perf(es/lexer): Reduce allocation while lexing identifiers #9076

Merged
merged 10 commits into from
Jun 18, 2024

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Jun 18, 2024

Description:

In the fast path, we don't even use the buffer.

Benchmarking es/lexer/cal-com
Benchmarking es/lexer/cal-com: Warming up for 3.0000 s
Benchmarking es/lexer/cal-com: Collecting 100 samples in estimated 5.5395 s (900 iterations)
Benchmarking es/lexer/cal-com: Analyzing
es/lexer/cal-com        time:   [6.1799 ms 6.2010 ms 6.2250 ms]
                        change: [-4.4027% -3.9504% -3.5372%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 17 outliers among 100 measurements (17.00%)
  4 (4.00%) high mild
  13 (13.00%) high severe

@kdy1 kdy1 added this to the Planned milestone Jun 18, 2024
@kdy1 kdy1 self-assigned this Jun 18, 2024
Copy link
Member Author

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

swc-bump:

  • swc_ecma_parser
  • swc_core

@kdy1 kdy1 marked this pull request as ready for review June 18, 2024 07:42
@kdy1 kdy1 requested a review from a team as a code owner June 18, 2024 07:42
@kdy1 kdy1 enabled auto-merge (squash) June 18, 2024 07:42
kodiakhq[bot]
kodiakhq bot previously approved these changes Jun 18, 2024
@kdy1 kdy1 enabled auto-merge (squash) June 18, 2024 08:13
kdy1 added a commit that referenced this pull request Jun 18, 2024
**Description:**

We don't need to push a character at a time. This profiling result does not include improvements from
#9076.

```
Benchmarking es/lexer/cal-com
es/lexer/cal-com        time:   [6.4555 ms 6.4936 ms 6.5368 ms]
```
Copy link
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

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

Automated review comment generated by auto-rebase script

@kdy1 kdy1 merged commit 69f00b8 into swc-project:main Jun 18, 2024
148 checks passed
@kdy1 kdy1 deleted the parser branch June 18, 2024 08:54
@kdy1 kdy1 modified the milestones: Planned, v1.6.3 Jun 19, 2024
@swc-project swc-project locked as resolved and limited conversation to collaborators Jul 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants