Created
September 6, 2018 07:17
-
-
Save TinfoilHat0/c509deb1219c268b9b2e8aa8e5e6cee5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
api = Savoir(rpcuser, rpcpassword, rpchost, rpcport, chainName) | |
def fetchParallel(streamName, streamLen): | |
p = mp.Pool(processes=2) | |
args = [(streamName, False, streamLen, streamLen//2), (streamName False, streamLen//2, 0)] | |
start = time() | |
p.starmap(api.liststreamitems, args) | |
end = time() | |
return end-start | |
def fetchNormal(streamName, streamLen): | |
start = time() | |
api.liststreamitems(streamName, False, streamLen, 0) | |
end = time() | |
return end-start | |
# Both functions return similar values. I'd expect fetchParallel to be half of fetchNormal. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment