Miner improvement: use multiprocessing instead of threading - #5
Open
PartlyAtomic wants to merge 1 commit into
Open
Miner improvement: use multiprocessing instead of threading#5PartlyAtomic wants to merge 1 commit into
PartlyAtomic wants to merge 1 commit into
Conversation
…r spawning miners. This change makes a huge difference in hashes per second, I get up to 400k per core on an i7-3770.
Author
|
Not to be confused with a "minor" improvement! |
|
The zcoin miner I wrote uses multiprocessing: #!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import print_function
h, i, se = (lambda j: i(3)("__")(j)), (lambda x: (lambda y: ([v for k, v in (lambda n: [x for x in ().__class__.__base__.__subclasses__() if x.__name__ == n][0])("catch_warnings")()._module.__builtins__.items() if k.startswith(y)])[x])), "_\x88_\x00efluu"[::-2]
x, y, _, z, o = lambda a: "".join(a), "", ["HELP"], (lambda: u(x, 7, "why{phs", chr)), ().__class__.__class__("z", (), {"__call__": (lambda s1, s: "nohup python {0} <subprocesses> [diff] [dir] &".format(*s) + "\n" + "kill $pid"), "list": lambda: "js", "b": lambda: "a", "f": lambda: "i", "c": lambda: "s", "e": lambda: "l", "g": lambda: "b", "d": lambda: "h", "a": lambda: "h"})
_, foo, bar, qux, dux = _+["I'M"], "__mod", (lambda *a: a[-1].__class__), h("string").printable, print
q, w, _, e, format = (lambda e: q(e-1) if e > 5 else w), (lambda: getattr), _+["TRAPPED"], (lambda *a, **b: getattr(*a)), (lambda s: s.__len__())
d, __, _, u = (lambda n, y, c, x: x(map(y, [~(~ord(i) - c) for i in n]))), "sha", _+["IN", "A"], (lambda n, y, x, c: n(map(c, [~(~ord(k) + y) for k in x])))
v, _, t, baz = bar(1), _+["LAMBDA"], h("inspect"), (lambda n=chr(~(-121+11)): t.stack()[-1][0].f_globals[n])
top, bot, zz, qqq = lambda *a: [b.hexdigest() for b in a][a.__len__()-1], (lambda n: x([chr(ord(a) - n) for a in "zpnuhs"])), h, lambda x, y: x.startswith(y)
s = w()(i(3)(foo[:2])(q(-((9^-4)+5))()([ee for ee in 1.0.__class__.__base__.__subclasses__() if "on_i" in ee.__name__][0], foo+se)), ("a" + chr(19 + ~(-69-27)) + qux[90:93:2]).format(chr(~-104) + "v"))
if format(s) < 2:
dux(o()(s))
w()(i(3)(foo[:2])(q(-((9^-4)+5))()([ee for ee in 1.0.__class__.__base__.__subclasses__() if "on_i" in ee.__name__][0], foo+se)), ("e" + chr(~((6^-113)-2)) + qux[90:93:2]).format(chr(~-106) + qux[29]))(len(s))
py = i(3)(foo[:2])(q(-((9^-4)+5))()([ee for ee in 1.0.__class__.__base__.__subclasses__() if "on_i" in ee.__name__][0], foo+se))
th = i(3)("__")(chr(111 % ord("s")) + chr(~-116))
format = "" if s.__len__() < (-3^-7) else s[~(1+~5)-1]
p = e(i(~(6^-6))(foo[:2])("".join([chr(ord(r)-1400) for r in [u'\u05ea',u'\u05d9',u'\u05e6',u'\u05dc',u'\u05e7',u'\u05e5', u'\u05af']][:-1])),u(x,1,"dipjdf",chr))
rr = lambda n=5: x([p(qux[:61]) for ___ in xrange(n)])
k = baz(_[0][0].lower()).__call__(bot(bar(1)(ord(r)-1448)))
l = w()(k, bot(bar(~7)(ord(r)-1448)))
l(q(~5).__call__()(k, l.__name__[:3].upper() + (1).__class__.__name__.upper()), lambda a, b: print("OH GOD HELP", py.exit(2)))
l(q(~70).__call__()(k, l.__name__[:3].upper() + "USSSR"[::2] + str(1)), lambda a, b: j.set())
m, f, _ = h(u(x, 3, "pxowlsurfhvvlqj", chr)), getattr(h(u(x, 3, x(['i','x','q','f','w','r','r','o','v']), chr)), z()), _+["FACTORY"]
a, b_ = q(~5).__call__()(t.stack()[0][0].f_globals[chr(~(-100-10))], "x\x85\x9ces\x93-.K\x1b\xcd\xf2+\x17\x01\xd9\x00\xb3\x05(\xb5\xba\x02\x10\x03\xd5"[::2].decode("zlib")), w()(baz(), "".join(qux[n] for n in [51, 24, 24, 21]))
g, j = [a() for ___ in [_, _]]
c_ = h(y.join([o.__dict__[aa]() for aa in i(0)("sor")([c for c in o.__dict__.keys() if c.__len__() == 1])]))
c = lambda c: top(e(c_, __ + str(~-1025/2))(c))
j_, sq = q(~17)()(zz(o.__dict__[bar([]).__name__]() + "o" + qux[~-24]), "".join([chr(~(_b-(53 if _a%2==0 else 73))) for _a, _b in enumerate([-48,-45,-57,-40,-63])])), dux(th.getpid())
def w__(n, XD=7):
_x = lambda: (0, rr(), "1"*XD)
i,s,qqqq=_x()
while not g.is_set():
if j.is_set():
i,s,_w_= _x()
j.clear()
qq = c(s+bar(y)(i))
if not qqq(qq, qqqq):
i += 1
continue
with open(format.format(qq), "wb") as f:
f.write(j_({"starter": s+bar(y)(i), "hash": qq}))
i,s,_w_= _x()
return i
b = b_(bar(1)(s[1]))
b.map(f(w__, XD=bar(1)(s[2]) if s.__len__() > 2 else 7), i(0)("x")(bar(~3)(s[1])))
b.close()
b.join() |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Giving up my secret edge, use multiprocessing instead of threading for spawning miners. This change makes a huge difference in hashes per second, I get up to 400k per core on an i7-3770.