user3758232
user3758232

Reputation: 862

Redland Python bindings very slow inserts

I am tetsing out Redland's Python bindings. From some simple tests, inserting data seems many, many times slower than RDFLib. A simple script such as:

import RDF

h1=RDF.HashStorage(
        "/var/tmp/redland.bdb", options="hash-type='bdb', contexts='yes'")
g = RDF.Model(h1)

for i in range(10000):
   if i % 100 == 0:
       print('Inserting {} triples.'.format(i))
   g.append(RDF.Statement(
           RDF.Uri('urn:s:{}'.format(i % 1000)), 
           RDF.Uri('urn:p:{}'.format(i %100)),
           RDF.Uri('urn:o:{}'.format(i))))

I am using Python 3.5, Redland 1.0.17 with BDB support (manually compiled).

takes several minutes to run, compared with a few seconds of RDFLib. 10K triples are a small number nowdays, so much that such performance would make the library almost unusable for most production scenarios; so I wonder if I am doing something really wrong here.

Thanks for the help,

Stefano

Upvotes: 1

Views: 54

Answers (0)

Related Questions