Mercurial > code > home > repos > homeauto
annotate service/piNode/rdflib_pi_opt.py @ 732:fdddbdaf07b5
more service renaming; start a lot more serv.n3 job files
Ignore-this: 635aaefc7bd2fa5558eefb8b3fc9ec75
author | drewp@bigasterisk.com |
---|---|
date | Thu, 06 Feb 2020 16:36:35 -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 |