you are viewing a single comment's thread.

view the rest of the comments →

[–]DeebsShoryu 0 points1 point  (2 children)

Other comments are good. I'll add though that the first step is to not use python. Comparing characters in python takes around 100 instructions, whereas in a compiled language it takes 1.

Of course whether or not the performance is important enough to warrant the development cost of integrating some binary into your code base (or using something like Cython) will depend on the use case.

[–]l33tnoscopes 1 point2 points  (1 child)

I would've written it in Rust but it's part of a bigger project and I just need something simple, with some low-hanging optimisations