Skip to content

perf: use set#418

Draft
jeswr wants to merge 3 commits intomainfrom
wip/set
Draft

perf: use set#418
jeswr wants to merge 3 commits intomainfrom
wip/set

Conversation

@jeswr
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Member

Sweet, I like the idea 👍

@RubenVerborgh
Copy link
Copy Markdown
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.

@RubenVerborgh RubenVerborgh force-pushed the main branch 3 times, most recently from 3a8218a to 64a6ce0 Compare April 12, 2025 20:03
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