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

serde_v8: restore ser/de benches #9939

Merged
merged 2 commits into from
Mar 31, 2021
Merged

serde_v8: restore ser/de benches #9939

merged 2 commits into from
Mar 31, 2021

Conversation

AaronO
Copy link
Contributor

@AaronO AaronO commented Mar 30, 2021

This restores the serde_v8 benches from the original repo, using bencher like core/benches/op_baseline.

Notes

The original benches were compared to serde_json working on existing strings. Whilst useful, these _json benches can be misleading and lead people to believe that serde_v8 is slower than using JSON for the op-layer, forgetting that using JSON requires the extra steps of JSON.parse()/.stringify() and co, not measured here.

Since they can't be meaningfully compared in absolute, it might make sense to remove them

Output

running 15 tests
test de_array_json        ... bench:         488 ns/iter (+/- 9)
test de_array_v8          ... bench:         601 ns/iter (+/- 19)
test de_bool_json         ... bench:          21 ns/iter (+/- 1)
test de_bool_v8           ... bench:           7 ns/iter (+/- 0)
test de_int_json          ... bench:          43 ns/iter (+/- 2)
test de_int_v8            ... bench:           7 ns/iter (+/- 1)
test de_str_json          ... bench:          49 ns/iter (+/- 5)
test de_str_v8            ... bench:          79 ns/iter (+/- 3)
test de_struct_json       ... bench:         142 ns/iter (+/- 3)
test de_struct_json_deopt ... bench:         466 ns/iter (+/- 15)
test de_struct_v8         ... bench:         231 ns/iter (+/- 11)
test de_struct_v8_opt     ... bench:          97 ns/iter (+/- 3)
test de_tuple_json        ... bench:          57 ns/iter (+/- 3)
test de_tuple_v8          ... bench:          69 ns/iter (+/- 0)
test de_tuple_v8_opt      ... bench:          68 ns/iter (+/- 9)

test result: ok. 0 passed; 0 failed; 0 ignored; 15 measured

     Running target/release/deps/ser-7e48eeb04c97e76a

running 13 tests
test ser_array_json       ... bench:         171 ns/iter (+/- 5)
test ser_array_v8         ... bench:         459 ns/iter (+/- 37)
test ser_bool_json        ... bench:          32 ns/iter (+/- 0)
test ser_bool_v8          ... bench:          60 ns/iter (+/- 1)
test ser_int_json         ... bench:          35 ns/iter (+/- 1)
test ser_int_v8           ... bench:          61 ns/iter (+/- 1)
test ser_str_json         ... bench:          48 ns/iter (+/- 1)
test ser_str_v8           ... bench:         119 ns/iter (+/- 2)
test ser_struct_json      ... bench:         155 ns/iter (+/- 1)
test ser_struct_v8        ... bench:         459 ns/iter (+/- 61)
test ser_struct_v8_manual ... bench:         538 ns/iter (+/- 90)
test ser_tuple_json       ... bench:          57 ns/iter (+/- 3)
test ser_tuple_v8         ... bench:         217 ns/iter (+/- 12)

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM

@ry ry merged commit 6dc3549 into denoland:main Mar 31, 2021
hardfist pushed a commit to hardfist/deno that referenced this pull request Aug 7, 2024
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.

2 participants