Skip to content

Comment on Why Python Is Slow: Looking Under the Hoodparent

Comments

I'm always wary of these kinds of sub-second benchmarks because more often than not you've only accidentally measured just the compilation and startup times.

I increased the iteration count by 10x and observed exactly the same pattern:

    $ time perl -ne 'print if /number 12345/' < file
    [...]
    real    0m1.661s
    user    0m1.586s
    sys     0m0.076s
    $ time grep "number 12345" file
    [...]
    real    0m0.188s
    user    0m0.132s
    sys     0m0.056s

Cool, thanks for entertaining my superstitions :)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.