Mercurial > code > home > repos > light9
changeset 1629:2fc0e726a3c3
rdfdb alternate graph formats for timing tests
Ignore-this: 4aea5721454500c088927b10ca17aae
author | drewp@bigasterisk.com |
---|---|
date | Sat, 10 Jun 2017 02:06:30 +0000 |
parents | 6d9c575200dd |
children | 2adbc27f77d3 |
files | bin/rdfdb |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/rdfdb Sat Jun 10 02:06:00 2017 +0000 +++ b/bin/rdfdb Sat Jun 10 02:06:30 2017 +0000 @@ -386,6 +386,14 @@ format = 'nt' elif accept == 'application/n-quads': format = 'nquads' + elif accept == 'pickle': + # don't use this; it's just for speed comparison + import cPickle as pickle + pickle.dump(self.settings.db.graph, self, protocol=2) + return + elif accept == 'msgpack': + self.write(repr(self.settings.db.graph.__getstate__)) + return self.write(self.settings.db.graph.serialize(format=format)) class Patches(PrettyErrorHandler, cyclone.web.RequestHandler):