quadstorejs / quadstore

A LevelDB-backed graph database for JS runtimes (Node.js, Deno, browsers, ...) supporting SPARQL queries and the RDF/JS interface.
https://github.com/quadstorejs/quadstore
MIT License
203 stars 14 forks source link

BACKEND: slow browser-side performance when using level-js / IndexedDB #121

Closed jacoscaz closed 3 years ago

jacoscaz commented 3 years ago

Conversation in #119 revealed significant gaps in performance when deployed browser-side using IndexedDB via the level-js backend.

These gaps seem to be mostly due to an objective difference in performance between LevelDB and IndexedDB (https://stackoverflow.com/a/22315353), even though the latter was originally modeled on the former. Should this turn out to be the case, there's little we could do that wouldn't involve crafting a completely different backend.

That said, we don't have a simple and automated way to measure these gaps as our performance tests have to be launched manually and only run in Node.js. Automating them and running them client-side would be a good idea.

jacoscaz commented 3 years ago

Indeed, this does seem to be the case. Browser-side usage via level-js may result in significantly worse performance levels, up to one order go magnitude. This is extremely annoying but there's nothing we can do except writing an entirely new AbstractLevelDOWN implementation that somehow manages to go around IndexedDB's issues. Perhaps it could use a combination of snapshots + AOF like Redis does. Closing for now, will reopen if anyone is interested and willing to help.