Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: use set #418

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

perf: use set #418

wants to merge 3 commits into from

Conversation

jeswr
Copy link
Collaborator

@jeswr jeswr commented Aug 5, 2024

Uses a set rather than object for the final layer of the index.

Short term performance gain from being able to use built-in set operations.

Long term gain from being able to use symbols for indicies

First tests seem to indicate a performance degredation

main

$ node perf/N3Store-perf.js 
N3Store performance test
- Adding 16777216 triples to the default graph: 23.328s
* Memory usage for triples: 855MB

This branch

$ node perf/N3Store-perf.js 
N3Store performance test
- Adding 16777216 triples to the default graph: 39.701s
* Memory usage for triples: 1083MB

@RubenVerborgh
Copy link
Member

Sweet, I like the idea 👍

@RubenVerborgh
Copy link
Member

RE: degradation, know that the benchmark might have a flawed design. It's an atypical insertion pattern. Retrieval is typically much more common than insertion.

Could be an option to have a switchable implementation where different read/write performance balance is desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants