Mercurial > code > home > repos > homeauto
annotate service/piNode/rdflib_pi_opt.py @ 762:5943cacc8b9b
stats page
Ignore-this: b59d958287c2381c908ec9583706966
author | drewp@bigasterisk.com |
---|---|
date | Fri, 14 Feb 2020 16:47:10 -0800 |
parents | 23ab244aa649 |
children |
rev | line source |
---|---|
640
23ab244aa649
move bnode id optimization to its own file. more logging cleanups
drewp@bigasterisk.com
parents:
diff
changeset
|
1 import rdflib.plugins.memory |
23ab244aa649
move bnode id optimization to its own file. more logging cleanups
drewp@bigasterisk.com
parents:
diff
changeset
|
2 |
23ab244aa649
move bnode id optimization to its own file. more logging cleanups
drewp@bigasterisk.com
parents:
diff
changeset
|
3 |
23ab244aa649
move bnode id optimization to its own file. more logging cleanups
drewp@bigasterisk.com
parents:
diff
changeset
|
4 def patchRandid(): |
23ab244aa649
move bnode id optimization to its own file. more logging cleanups
drewp@bigasterisk.com
parents:
diff
changeset
|
5 """ |
23ab244aa649
move bnode id optimization to its own file. more logging cleanups
drewp@bigasterisk.com
parents:
diff
changeset
|
6 I'm concerned urandom is slow on raspberry pi, and I'm adding to |
23ab244aa649
move bnode id optimization to its own file. more logging cleanups
drewp@bigasterisk.com
parents:
diff
changeset
|
7 graphs a lot. Unclear what the ordered return values might do to |
23ab244aa649
move bnode id optimization to its own file. more logging cleanups
drewp@bigasterisk.com
parents:
diff
changeset
|
8 the balancing of the graph. |
23ab244aa649
move bnode id optimization to its own file. more logging cleanups
drewp@bigasterisk.com
parents:
diff
changeset
|
9 """ |
23ab244aa649
move bnode id optimization to its own file. more logging cleanups
drewp@bigasterisk.com
parents:
diff
changeset
|
10 _id_serial = [1000] |
23ab244aa649
move bnode id optimization to its own file. more logging cleanups
drewp@bigasterisk.com
parents:
diff
changeset
|
11 def randid(): |
23ab244aa649
move bnode id optimization to its own file. more logging cleanups
drewp@bigasterisk.com
parents:
diff
changeset
|
12 _id_serial[0] += 1 |
23ab244aa649
move bnode id optimization to its own file. more logging cleanups
drewp@bigasterisk.com
parents:
diff
changeset
|
13 return _id_serial[0] |
23ab244aa649
move bnode id optimization to its own file. more logging cleanups
drewp@bigasterisk.com
parents:
diff
changeset
|
14 rdflib.plugins.memory.randid = randid |