News for hackers. Stuff that matters.
Re:A Python Optimization Anecdote by maximilianburke on Tuesday October 25, 2011 @02:19PM (#3155177)
I hate to break up perfectly good hand-waving with numbers but I put together a test. On my Core i7 with an 18mb input, which is a large novel duplicated many times, the performance factors, normalized to the if-based version are:

    if: 1x
    byte-based lookup: 0.83x
    int-based lookup: 0.84x
    bit-vector based lookup: 0.93x
http://pastebin.com/5twfXfEt

There are no comments on this comment yet.