diff service/piNode/rdflib_pi_opt.py @ 1443:99540f1a11f7

move bnode id optimization to its own file. more logging cleanups Ignore-this: 1787f7268eafa52e7c094e327333021c darcs-hash:3cf4550608b04f4ff91a76a3a00b129f0d9bcccb
author drewp <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