Closed mert-kurttutan closed 1 year ago
It's because we drop the GIL. Let me flip the question — why would you expect a performance gain? The comment in source indicates that I did do profiling ;-)
Ohh, I see thanks. I guess I thought releasing GIL would not allow multiple threads to run that efficiently.
Thanks for confirming the benchmark! Always happy to see people investigate potential performance improvements :-)
Hi, I just tried to test your comment on why you went with python threading option. Indeed, I got similar results to your comment.
Obtained with pytest-benchmark plugin
Fork: https://github.com/mert-kurttutan/tiktoken/tree/main
I am wondering why there is no performance gain with rust in comparison to python? Is this expected despite each encoding operation being a CPU heavy operation? Did you do any analysis/profiling on this issue?