mirror of
https://github.com/9001/copyparty.git
synced 2026-03-24 09:02:55 +10:00
nogil: remove -j (multiprocessing option)
in case cpython's free-threading / nogil performance proves to be good enough that the multiprocessing option can be removed, this is roughly how you'd do it (not everything's been tested) but while you'd expect this change to improve performance, it somehow doesn't, not even measurably so as the performance gain is negligible, the only win here is simplifying the code, and maybe less chance of bugs in the future as a result, this probably won't get merged anytime soon (if at all), and would probably warrant bumping to v2
This commit is contained in:
@@ -170,12 +170,14 @@ class Cfg(Namespace):
|
||||
)
|
||||
|
||||
|
||||
class NullBroker(object):
|
||||
def say(self, *args):
|
||||
class NullUp2k(object):
|
||||
def hash_file(*a):
|
||||
pass
|
||||
|
||||
def ask(self, *args):
|
||||
pass
|
||||
|
||||
class NullHub(object):
|
||||
def __init__(self):
|
||||
self.up2k = NullUp2k()
|
||||
|
||||
|
||||
class VSock(object):
|
||||
@@ -206,7 +208,7 @@ class VHttpSrv(object):
|
||||
self.asrv = asrv
|
||||
self.log = log
|
||||
|
||||
self.broker = NullBroker()
|
||||
self.hub = NullHub()
|
||||
self.prism = None
|
||||
self.bans = {}
|
||||
self.nreq = 0
|
||||
|
||||
Reference in New Issue
Block a user