PSeitz / serde_json_borrow

Fast JSON deserialization on borrowed data
MIT License
70 stars 11 forks source link

pre-allocate arrays #1

Closed yanns closed 1 year ago

yanns commented 1 year ago

By pre-allocating arrays, we can avoid resizing. Locally almost all benchmarks have improved.

PSeitz commented 1 year ago

awesome, I didn't know there is size_hint available

yanns commented 1 year ago

I think I went the same path as you in https://github.com/yanns/proto_refexp/pull/4 ;)

yanns commented 1 year ago

But thanks to your repo, I could simplify my code, thanks!