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] explore whether mimalloc would improve performance #752

Closed
0xdevalias opened this issue Dec 6, 2023 · 2 comments
Closed

[perf] explore whether mimalloc would improve performance #752

0xdevalias opened this issue Dec 6, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@0xdevalias
Copy link

0xdevalias commented Dec 6, 2023

⭐ Suggestion

I'm not deeply familiar with things in this area, but stumbled across the following and thought it might be of use:

@0xdevalias 0xdevalias added the enhancement New feature or request label Dec 6, 2023
@HerringtonDarkholme
Copy link
Member

Thanks for the direction! I will try the mimalloc!

@HerringtonDarkholme
Copy link
Member

Before

> benches@1.0.0 bench /Users/bytedance/code/ast-grep/benches
> node -r ts-node/register/transpile-only bench.ts

Running "parseSyncBench: Parse One Line" suite...
Progress: 100%

  ast-grep sync parse:
    67 063 ops/s, ±0.86%   | fastest

Finished 1 case!
Running "parseSyncBench: Parse Small File" suite...
Progress: 100%

  ast-grep sync parse:
    4 428 ops/s, ±1.45%   | fastest

Finished 1 case!
Running "parseSyncBench: Parse Medium File" suite...
Progress: 100%

  ast-grep sync parse:
    221 ops/s, ±9.99%   | fastest

Finished 1 case!
Running "parseSyncBench: Parse Huge File" suite...
Progress: 100%

  ast-grep sync parse:
    1 ops/s, ±11.19%   | fastest

Finished 1 case!
Running "parseAsyncBench: Parse One Line" suite...
Progress: 100%

  ast-grep async parse:
    25 944 ops/s, ±32.74%   | fastest

Finished 1 case!
Running "parseAsyncBench: Parse Small File" suite...
Progress: 100%

  ast-grep async parse:
    7 050 ops/s, ±4.79%   | fastest

Finished 1 case!
Running "parseAsyncBench: Parse Medium File" suite...
Progress: 100%

  ast-grep async parse:
    497 ops/s, ±12.38%   | fastest

Finished 1 case!
Running "parseAsyncBench: Parse Huge File" suite...
Progress: 100%

  ast-grep async parse:
    3 ops/s, ±8.51%   | fastest

Finished 1 case!

After

Running "parseSyncBench: Parse One Line" suite...
Progress: 100%

  ast-grep sync parse:
    69 787 ops/s, ±0.73%   | fastest

Finished 1 case!
Running "parseSyncBench: Parse Small File" suite...
Progress: 100%

  ast-grep sync parse:
    4 355 ops/s, ±4.07%   | fastest

Finished 1 case!
Running "parseSyncBench: Parse Medium File" suite...
Progress: 100%

  ast-grep sync parse:
    236 ops/s, ±3.50%   | fastest

Finished 1 case!
Running "parseSyncBench: Parse Huge File" suite...
Progress: 100%

  ast-grep sync parse:
    1 ops/s, ±8.67%   | fastest

Finished 1 case!
Running "parseAsyncBench: Parse One Line" suite...
Progress: 100%

  ast-grep async parse:
    20 724 ops/s, ±76.62%   | fastest

Finished 1 case!
Running "parseAsyncBench: Parse Small File" suite...
Progress: 100%

  ast-grep async parse:
    6 530 ops/s, ±6.70%   | fastest

Finished 1 case!
Running "parseAsyncBench: Parse Medium File" suite...
Progress: 100%

  ast-grep async parse:
    437 ops/s, ±21.82%   | fastest

Finished 1 case!
Running "parseAsyncBench: Parse Huge File" suite...
Progress: 100%

  ast-grep async parse:
    2 ops/s, ±26.03%   | fastest

Finished 1 case!

I cannot see a reliable difference in napi, though.

@HerringtonDarkholme HerringtonDarkholme closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants