Mercurial > code > home > repos > homeauto
diff service/piNode/rdflib_pi_opt.py @ 640:23ab244aa649
move bnode id optimization to its own file. more logging cleanups
Ignore-this: 1787f7268eafa52e7c094e327333021c
author | drewp@bigasterisk.com |
---|---|
date | Mon, 12 Aug 2019 16:46:52 -0700 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/service/piNode/rdflib_pi_opt.py Mon Aug 12 16:46:52 2019 -0700 @@ -0,0 +1,14 @@ +import rdflib.plugins.memory + + +def patchRandid(): + """ + I'm concerned urandom is slow on raspberry pi, and I'm adding to + graphs a lot. Unclear what the ordered return values might do to + the balancing of the graph. + """ + _id_serial = [1000] + def randid(): + _id_serial[0] += 1 + return _id_serial[0] + rdflib.plugins.memory.randid = randid