Scanning a file

Fredrik Lundh fredrik at pythonware.com
Sun Oct 30 02:55:06 EST 2005


Paul Watson wrote:

> This is Cyngwin on Windows XP.

using cygwin to analyze performance characteristics of portable API:s
is a really lousy idea.

here are corresponding figures from a real operating system:

using a 16 MB file:

    $ time python2.4 scanmap.py
    real    0m0.080s
    user    0m0.070s
    sys     0m0.010s

    $ time python2.4 scanpaul.py
    real    0m0.458s
    user    0m0.450s
    sys     0m0.010s

using a 256 MB file (50% of available memory):

    $ time python2.4 scanmap.py
    real    0m0.913s
    user    0m0.810s
    sys     0m0.100s

    $ time python2.4 scanpaul.py
    real    0m7.149s
    user    0m6.950s
    sys     0m0.200s

using a 1024 MB file (200% of available memory):

    $ time python2.4 scanpaul.py
    real    0m34.274s
    user    0m28.030s
    sys     0m1.350s

    $ time python2.4 scanmap.py
    real    0m20.221s
    user    0m3.120s
    sys     0m1.520s

(Intel(R) Pentium(R) 4 CPU 2.80GHz, 512 MB RAM, relatively slow ATA
disks, relatively recent Linux, best result of multiple mixed runs shown.
scanmap performance would probably improve if Python supported the
"madvise" API, but I don't have time to test that today...)

</F>






More information about the Python-list mailing list