Shopify / protoboeuf

Experimenting with a protobuf implementation
MIT License
24 stars 2 forks source link

Speed up string encoding. #78

Closed tenderworks closed 3 months ago

tenderworks commented 3 months ago

We go from 7x slower to 5.7x slower

On main:

ruby 3.4.0dev (2024-04-09T16:29:01Z master 0107954f25) +YJIT [arm64-darwin23]
Warming up --------------------------------------
     encode upstream    10.000 i/100ms
   encode protoboeuf     1.000 i/100ms
Calculating -------------------------------------
     encode upstream    103.699 (± 1.9%) i/s -    520.000 in   5.016519s
   encode protoboeuf     14.757 (± 0.0%) i/s -     74.000 in   5.017772s

Comparison:
     encode upstream:      103.7 i/s
   encode protoboeuf:       14.8 i/s - 7.03x  slower

On this branch:

ruby 3.4.0dev (2024-04-09T16:29:01Z master 0107954f25) +YJIT [arm64-darwin23]
Warming up --------------------------------------
     encode upstream     9.000 i/100ms
   encode protoboeuf     1.000 i/100ms
Calculating -------------------------------------
     encode upstream     96.992 (± 3.1%) i/s -    486.000 in   5.014981s
   encode protoboeuf     16.808 (± 0.0%) i/s -     84.000 in   5.001598s

Comparison:
     encode upstream:       97.0 i/s
   encode protoboeuf:       16.8 i/s - 5.77x  slower