RDFLib/rdflib — pull request #318 by joernhees (2013-08-01 19:30:45+00:00)
Title: quad serializations take a long time

I hesitate to report this as a bug since I don't understand all that's going on in serialize, but following up on my report on the list a while ago all of the quad serializations take a lot of time. I did a crude time test on my graph of 75k statements, both parsing and serializing:

>>> rdflib.__version__
'4.1-dev'

>>> def timeit():
... start = time()
... cg.parse('candidates.trig', format='trig')
... elapsed = time() - start
... print elapsed
...
>>> timeit()
22.5815250874
>>> len(cg)
75840
>>> def timeit():
... start = time()
... cg.serialize(format='trig')
... elapsed = time() - start
... print elapsed
...
>>> timeit()
2746.05100608

As usual, I'm pretty far out of my depth here, but 45min seems long for a graph of this size.