-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
String#append_bytes
if available
This is just a proof of concept / demo, there are some unknown about how codegen is supposed to know if it's OK to use newly introduced methods. I also hacked the benchmark to load two versions of protoboeuf so I can compare them together, that's proable not how we want it but it gives a much clearer picture of the speedup. ``` /opt/rubies/head/bin/ruby --yjit -I lib:bench/lib bench/benchmark.rb total encoded size: 5038040 bytes === encode === ruby 3.4.0dev (2024-08-26T08:40:45Z string-append-bytes 28a1b94c15) +YJIT [arm64-darwin23] Warming up -------------------------------------- upstream/jit 13.000 i/100ms protoboeuf/jit 5.000 i/100ms pboeuf-edge/jit 5.000 i/100ms Calculating ------------------------------------- upstream/jit 126.321 (± 4.7%) i/s - 637.000 in 5.053302s protoboeuf/jit 51.886 (± 3.9%) i/s - 260.000 in 5.017310s pboeuf-edge/jit 58.609 (± 3.4%) i/s - 295.000 in 5.041832s Comparison: upstream/jit: 126.3 i/s pboeuf-edge/jit: 58.6 i/s - 2.16x slower protoboeuf/jit: 51.9 i/s - 2.43x slower ```
- Loading branch information
Showing
3 changed files
with
78 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters