bit icon indicating copy to clipboard operation
bit copied to clipboard

speed in idle

Open AndZhig opened this issue 7 years ago • 2 comments

Why speed of execution in console $ python -m timeit -s "from bit import Key;k=Key()" "k.address" faster than in IDLE? In IDLE 100000 take 10 sec.

from bit import Key

start_time = time.time()

i = 100000 while i >= 1:

k=Key()
k.address

i = i -1

print("--- %s seconds ---" % (time.time() - start_time))

AndZhig avatar Aug 12 '18 07:08 AndZhig

Is IDLE some kind of Python builtin, or do you just mean a super basic loop? Might be some kind of Python optimization that I have little knowledge of.

Also, your markdown is a bit wonky.

ghost avatar Aug 14 '18 04:08 ghost

it's because of some Tkinter Text widget. here the output or write in the terminal or somehow manually the functions called in the code to register through numba if possible. For scanning "32 btc puzzle" (what is it you can find out in google) at least 1000000 key per sec to get.

import time from bit import * from numba import jit import random

@jit def ran(): a = random.randint(36028797018963968,72057594037927936) return a

while 1 == 1:

start_time = time.time()
i = 100000
while i >= 1:
    b = ran()
    key = Key.from_int(b)
    addr = key.address
    if addr == "17aPYR1m6pVAacXg1PTDDU7XafvK1dxvhi":
        print ("found!!!",addr,b)
        s1 = str(b)
        s2 = addr
        f=open(u"C:/a.txt","a")
        f.write(s1)
        f.write(s2)       
        f.close()
        break
    else:
        pass

    


    i = i -1
print("--- %s seconds ---" % (time.time() - start_time),addr,b)
time.sleep(1.0)
pass

AndZhig avatar Aug 14 '18 13:08 AndZhig