Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

md5 shit in python

Name: Anonymous 2009-01-20 23:22

import os, md5;

for root, dirs, files in os.walk(os.path.abspath('')):
    for f in files:
        e = os.path.splitext(f)[1]
        if (e and e not in [".py",".db"]):
            h = md5.new(file(f,'rb').read()).hexdigest()
            n = h + e
            try:
                os.rename(f,n)
            except WindowsError:
                os.unlink(n)
                os.rename(f,n)
            print n + " " + f


How do I optimize this, I'm watching SICP right now

Name: Anonymous 2009-01-22 10:09

>>26
They don't do the same thing, so comparing their speed would be useless. Lea doesn't move the instruction pointer.

But if you insist, nop has a latency of 1/3 while I would guess lea has at least 4, depending on the memory address.

Ergo, to move the eip 100000 bytes, 100000 nops would take 33333 cycles and 16666 leas would take 66666.

And using fnop instead of nop halves the needed cycles, being 4 times faster than lea, so you are utterly wrong.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List