# HG changeset patch # User drewp@bigasterisk.com # Date 1458559439 25200 # Node ID 0c4ec87d4498a91f3425437b13e7810199daa992 # Parent b97495befcaba9c8949b3f4a56fe0a1efaaf61c4 try a speedup for raspi Ignore-this: 9cdbabb99c9888792c167866f06d65eb diff -r b97495befcab -r 0c4ec87d4498 service/piNode/piNode.py --- a/service/piNode/piNode.py Mon Mar 21 04:22:39 2016 -0700 +++ b/service/piNode/piNode.py Mon Mar 21 04:23:59 2016 -0700 @@ -36,6 +36,20 @@ CTX = ROOM['pi/%s' % hostname] +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] + import rdflib.plugins.memory + rdflib.plugins.memory.randid = randid +patchRandid() + class Config(object): def __init__(self, masterGraph): self.graph = ConjunctiveGraph() @@ -43,6 +57,7 @@ for f in os.listdir('config'): if f.startswith('.'): continue self.graph.parse('config/%s' % f, format='n3') + log.info(' parsed %s', f) self.graph.bind('', ROOM) # not working self.graph.bind('rdf', RDF) # config graph is too noisy; maybe make it a separate resource @@ -245,6 +260,7 @@ (r'/output', OutputPage), (r'/dot', Dot), ], config=config, board=board, debug=arg['-v']), interface='::') + log.warn('serving on 9059') reactor.run() main()