| ▲ | 6× faster binary search: from compiled code to mechanical sympathy(pythonspeed.com) | |||||||
| 13 points by enz 10 hours ago | 3 comments | ||||||||
| ▲ | pillmillipedes 6 hours ago | parent | next [-] | |||||||
I think putting the buckets in eytzinger layout might help with cache locality here? though on the other hand they might all fit into cache anyways.. I'd also want to try interpolation search for this (not necessarily linear interpolation since we're doing floats) - you can take much better guesses than "it's in the middle somewhere" by not having to look at the data through a 1-bit-wide pinhole as comparison algorithms do. | ||||||||
| ||||||||
| ▲ | moi2388 6 hours ago | parent | prev [-] | |||||||
“ How do you speed up computational Python code? A common, and useful, starting point is” A better starting point is: use a better language. Python is terrible and unbearably slow. If you need anything serious or performant, switch to something else. | ||||||||