Shopify / protoboeuf

Experimenting with a protobuf implementation
MIT License
37 stars 4 forks source link

Encoding performance #98

Closed tenderlove closed 3 months ago

tenderlove commented 3 months ago

Default string literals to be encoded as ascii-8bit so we can avoid calling .b on string literals. Also change string literals to be mutable so we can avoid calling .dup on string literal buffers.

This should reduce method calls, but I didn't see any change in performance. I suspect that since the time is being dominated by String#<< this won't make much difference until we better support String#<< in YJIT

cc @nirvdrum

maximecb commented 3 months ago

It's a bit surprising that time is so dominated by string concat that it dwarfs everything else so completely. Would be curious to see profiling data.