3 ms·
I did similar Rust/Python record generation experiments, and I can relate to these numbers. However, I think your Rust threaded trial might be a little bit off
by Fiahil 5y ago
I did similar Rust/Python record generation experiments, and I can relate to these numbers.
However, I think your Rust threaded trial might be a little bit off in subtle ways. I would truly expect it to perform about several times better than single threaded Rust and async Rust (async is generally slower on these workloads, but still faster than Python)
Edit : After reading your rust code, you might have room for some improvements :
- don’t rely on random, simply cycle through your values
- pre-allocate your vecs with ˋwith_capacityˋ
- dont use channels, prefer deques..
- ..or even better, don’t use synchronization primitives and open one connection per thread (not sure if it will work with sqlite?)