kafka-protocol-rs icon indicating copy to clipboard operation
kafka-protocol-rs copied to clipboard

Replace indexmap with vec

Open rukai opened this issue 1 year ago • 0 comments

Possible solution for https://github.com/tychedelia/kafka-protocol-rs/issues/84

I'll have a go at porting my application to it and report back.

edit: https://github.com/shotover/shotover-proxy/pull/1759 The benchmark for decoding produce requests improved by 20% !

Fun fact I realized about IndexMap is its actually backed by 2 allocations. So if we create a HashMap (1 allocation) to construct a request to be batch encoded, and then convert that to a Vec (1 allocation) to be compatible with kafka-protocol, that is actually the same number of allocations as just using IndexMap.

Will think about this some more.

rukai avatar Sep 30 '24 06:09 rukai