view service/piNode/rdflib_pi_opt.py @ 1514:78ee4d27ea87

release 0.11.0 Ignore-this: 58e616ca09c022d0a43e4f08e21ba6ab darcs-hash:8d78e75db3e8cd37c0b0227edc99ef6da7eaa49d
author drewp <drewp@bigasterisk.com>
date Mon, 03 Feb 2020 23:47:25 -0800
parents 99540f1a11f7
children
line wrap: on
line source

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