Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speed in idle #41

Open
AndZhig opened this issue Aug 12, 2018 · 2 comments
Open

speed in idle #41

AndZhig opened this issue Aug 12, 2018 · 2 comments

Comments

@AndZhig
Copy link

AndZhig commented Aug 12, 2018

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))

@ghost
Copy link

ghost commented Aug 14, 2018

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.

@AndZhig
Copy link
Author

AndZhig commented Aug 14, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant