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

Node.js is 300x faster than Bun at isbot regexp #5197

Open
strager opened this issue Sep 13, 2023 · 3 comments
Open

Node.js is 300x faster than Bun at isbot regexp #5197

strager opened this issue Sep 13, 2023 · 3 comments
Labels
performance An issue with performance

Comments

@strager
Copy link

strager commented Sep 13, 2023

What version of Bun is running?

1.0.1

What platform is your computer?

Linux 5.19.0-46-generic x86_64 x86_64

What steps can reproduce the bug?

$ # Download the test script and test file: https://github.com/quick-lint/bun-vs-node/tree/f5ca9314fde7432f8b20339b8380bb15203606af/bun-regexp-bug
$ git clone --depth=1 git@github.com:quick-lint/bun-vs-node.git
$ cd bun-vs-node/bun-regexp-bug/

$ node benchmark.mjs               
263487 lines processed
took 201.37601999938488 ms

$ bun run benchmark.mjs         
263487 lines processed
took 65417.94360200001 ms

What is the expected behavior?

Node.js and Bun have comparable performance. Maybe one is twice as fast as the other.

What do you see instead?

Bun is significantly slower than Node.js with this regexp.

Additional information

Possibly related: #3464

@strager strager added the bug Something isn't working label Sep 13, 2023
@paperdave paperdave added the performance An issue with performance label Sep 13, 2023
@vegerot
Copy link

vegerot commented Sep 17, 2023

@dylang
Copy link
Contributor

dylang commented Sep 25, 2023

Hi! I don't suppose it's possible to use https://github.com/google/re2 as a replacement to JSC's regex engine until the performance problems can be addressed?

@Electroid Electroid removed the bug Something isn't working label Oct 27, 2023
@zoto-ff
Copy link

zoto-ff commented Aug 7, 2024

Hi! I don't suppose it's possible to use https://github.com/google/re2 as a replacement to JSC's regex engine until the performance problems can be addressed?

i think no because it's not compatible with JS standarts. you can try to use node-re2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance An issue with performance
Projects
None yet
Development

No branches or pull requests

6 participants