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(ext/node): improve Buffer.from(buffer) #24352

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

0f-0b
Copy link
Contributor

@0f-0b 0f-0b commented Jun 26, 2024

Benchmark code from #24341.

$ deno run --allow-hrtime bench.mjs
6479.111583
$ target/release/deno run --allow-hrtime bench.mjs
962.753875
$ node bench.mjs
855.174875

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

Thanks @0f-0b! Do you know how this compares to the previous deno release?

@0f-0b
Copy link
Contributor Author

0f-0b commented Jun 26, 2024

Do you know how this compares to the previous deno release?

I added benchmark results to the PR description. It's ~6 times faster than 1.44.4, but slightly slower than node 22.3.0.

@dsherret dsherret changed the title fix(ext/node): Buffer.from(buffer) creates a copy perf(ext/node): improve Buffer.from(buffer) Jun 26, 2024
@dsherret dsherret merged commit 86e0292 into denoland:main Jun 26, 2024
17 checks passed
@0f-0b 0f-0b deleted the fix-buffer-from-buffer branch June 26, 2024 21:22
sbmsr pushed a commit to sbmsr/deno-1 that referenced this pull request Jul 2, 2024
Benchmark code from denoland#24341.

```shellsession
$ deno run --allow-hrtime bench.mjs
6479.111583
$ target/release/deno run --allow-hrtime bench.mjs
962.753875
$ node bench.mjs
855.174875
```
zebreus pushed a commit to zebreus/deno that referenced this pull request Jul 8, 2024
Benchmark code from denoland#24341.

```shellsession
$ deno run --allow-hrtime bench.mjs
6479.111583
$ target/release/deno run --allow-hrtime bench.mjs
962.753875
$ node bench.mjs
855.174875
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants