Performance hits when using this crate #67
Replies: 2 comments 7 replies
-
Hi, thanks a lot for doing performance tests. I would very much appreciate a PR which will improve performance. I might look into it myself as well. As long as indeed all the cache misses has some mutex, as you don't want to make a call to Schema Registry for the time between that ID was first encountered, till the result is cached. That's basically the main challenge. |
Beta Was this translation helpful? Give feedback.
-
As promised, I took some time to look into a The results is there: #70 I hope you find it interesting! |
Beta Was this translation helpful? Give feedback.
-
Hi (again)
Disclaimer : please bear with me, I plan on using (if you're okay) this discussion as a notebook to my findings to allow anyone to suggest / review / argue my methodology and thoughts instead of doing it on my own. My intention is to find ways to improve this useful crate while making sure we get the best experience and performance out of it.
While working around how to deserialize Avro messages in a consumer, I started measuring the latency of deserialization using vanilla avro-rs, struct mapped deserialization with vanilla avro-rs and then using the async_impl with EasyAvroDecoder
What I'm using as a baseline on my environment is:
vec![0.0001, 0.00025, 0.0005, 0.001, 0.0025, 0.005, 0.01, 0.025, 0.05, 0.1],
meaning that my lowest grain is 100 micro secondsI'm measuring the max of P50, P75 and P95 of the deserialization function between my replicas
hardcoded schema + avro-rs
schema_registry_converter async_impl + easy avro
First finding :
Using schema_registry_converter impacts my (max) overall throughput very badly : (~100K msg/s vs ~56K msg/s)
First lead :
EasyAvroDecoder uses a Mutex on the whole decode function, but so far I was under the impression that the lock is useful only for the cases when the schema is not in cache so : maybe we should only use a Mutex on cache misses?
I did not yet look at the code for this, but maybe there's already a strong argument and I would waste my time.
I hope this is helpful and constructive
Thanks
Beta Was this translation helpful? Give feedback.
All reactions