mapbox / pbf

A low-level, lightweight protocol buffers implementation in JavaScript.
BSD 3-Clause "New" or "Revised" License
796 stars 106 forks source link

Performance question #118

Closed anri-asaturov closed 4 years ago

anri-asaturov commented 4 years ago

Does it make sense to reuse Pbf instance for writing? pbf.finish().slice() to get a copy of the result to avoid race condition and reset pos/length?

mourner commented 4 years ago

It probably makes sense, although the difference might not be significant. You can always benchmark for your use case though!