Re:Why Python is Slow: Looking Under the Hood
by theseoafs on Saturday May 10, 2014 @01:42AM
(#7724631)
Dynamic allocation isn't the only cost there -- a cost that's just as big when you're doing number crunching in Python is cache efficiency. If every number is on the heap, and every number in Python is ~20 bytes long, you're going to have caching problems, even if your numbers only ever range from -5 to 256.
http://www.laurentluce.com/posts/python-integer-objects-impl...