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: use fast api for io read/write sync #15863

Merged
merged 11 commits into from
Dec 2, 2022

Conversation

littledivy
Copy link
Member

@littledivy littledivy commented Sep 11, 2022

$ dd if=/dev/zero bs=65536 count=500000 | ./stdio # C baseline

500000+0 records in
500000+0 records out
32768000000 bytes transferred in 4.126087 secs (7941664827 bytes/sec)
c: size 32768000000 reads 500000 blocksize 65536
$ dd if=/dev/zero bs=65536 count=500000 | deno run stdio.js # Deno

500000+0 records in
500000+0 records out
32768000000 bytes transferred in 4.279032 secs (7657806719 bytes/sec)
deno: size 32768000000 reads 500000 blocksize 65536

@littledivy littledivy changed the title perf: use fast api for stdio read/write perf: use fast api for io read/write sync Sep 11, 2022
@billywhizz
Copy link
Contributor

LGTM. i have tested on ubuntu and results are same - pretty much same perf from node.js, deno, bun and the C program. 🥳

@littledivy littledivy marked this pull request as ready for review September 23, 2022 03:31
@ry
Copy link
Member

ry commented Nov 14, 2022

@littledivy is this something you still want to land?

@ry
Copy link
Member

ry commented Nov 15, 2022

I don't see much of a difference here between 1.27.0, 1.28.0 and this branch (target/release/deno)

~/src/deno#  dd if=/dev/zero bs=65536 count=500000 | deno-1.27.0 run ./cli/bench/stdio/stdio.js
500000+0 records in
500000+0 records out
32768000000 bytes transferred in 4.244542 secs (7720031985 bytes/sec)
size 32768000000 reads 500000 blocksize 65536
~/src/deno#  dd if=/dev/zero bs=65536 count=500000 | target/release/deno run ./cli/bench/stdio/stdio.js
500000+0 records in
500000+0 records out
32768000000 bytes transferred in 4.209363 secs (7784550774 bytes/sec)
size 32768000000 reads 500000 blocksize 65536
~/src/deno#  dd if=/dev/zero bs=65536 count=500000 | deno run ./cli/bench/stdio/stdio.js
500000+0 records in
500000+0 records out
32768000000 bytes transferred in 4.264025 secs (7684757946 bytes/sec)
size 32768000000 reads 500000 blocksize 65536
~/src/deno#  dd if=/dev/zero bs=65536 count=500000 | deno-1.27.0 run ./cli/bench/stdio/stdio.js
500000+0 records in
500000+0 records out
32768000000 bytes transferred in 4.295659 secs (7628166016 bytes/sec)
size 32768000000 reads 500000 blocksize 65536
~/src/deno#  dd if=/dev/zero bs=65536 count=500000 | deno-1.27.0 run ./cli/bench/stdio/stdio.js
500000+0 records in
500000+0 records out
32768000000 bytes transferred in 4.242691 secs (7723400078 bytes/sec)
size 32768000000 reads 500000 blocksize 65536
~/src/deno#  dd if=/dev/zero bs=65536 count=500000 | target/release/deno run ./cli/bench/stdio/stdio.js
500000+0 records in
500000+0 records out
32768000000 bytes transferred in 4.157847 secs (7881001874 bytes/sec)
size 32768000000 reads 500000 blocksize 65536

@littledivy
Copy link
Member Author

It's not a noticable difference but the ops can use fast api instead of serde_v8.

@littledivy
Copy link
Member Author

Bump

@littledivy littledivy merged commit 6982c74 into denoland:main Dec 2, 2022
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.

4 participants