From be27ea0b7b378d28db8ecf2c864635948d62549b Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Tue, 30 Apr 2024 15:55:50 +0200 Subject: [PATCH] Enable codspeed performance measuring in CI --- .github/workflows/ci.yml | 24 ++- package.json | 2 + perf/benchmark.ts | 26 ++++ perf/run.ts | 315 +------------------------------------- perf/tests.ts | 316 +++++++++++++++++++++++++++++++++++++++ yarn.lock | 102 ++++++++++++- 6 files changed, 469 insertions(+), 316 deletions(-) create mode 100644 perf/benchmark.ts create mode 100644 perf/tests.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d970a04..0defc90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,13 @@ name: CI -on: [push, pull_request] +on: + push: + branches: + - 'master' # or "master" + pull_request: + # `workflow_dispatch` allows CodSpeed to trigger backtest + # performance analysis in order to generate initial data. + workflow_dispatch: + jobs: lint: @@ -22,7 +30,6 @@ jobs: matrix: os: [ubuntu-latest] node-version: - - 14.x - 16.x - 18.x - 20.x @@ -61,3 +68,16 @@ jobs: with: github-token: ${{ secrets.github_token }} parallel-finished: true + + benchmarks: + runs-on: ubuntu-latest + steps: + - uses: "actions/checkout@v3" + - uses: "actions/setup-node@v3" + - name: Install dependencies + run: yarn install + - name: Run benchmarks + uses: CodSpeedHQ/action@v2 + with: + run: node perf/benchmark.js + token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/package.json b/package.json index e21535d..17b65e8 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "test" ], "devDependencies": { + "@codspeed/tinybench-plugin": "^3.1.0", "@rubensworks/eslint-config": "^1.0.0", "@types/jest": "^29.0.0", "@types/n3": "^1.10.4", @@ -68,6 +69,7 @@ "n3": "^1.16.3", "pre-commit": "^1.2.2", "streamify-array": "^1.0.1", + "tinybench": "^2.8.0", "ts-jest": "^29.0.0", "typescript": "^5.0.0", "yargs": "^17.7.1" diff --git a/perf/benchmark.ts b/perf/benchmark.ts new file mode 100644 index 0000000..17bd986 --- /dev/null +++ b/perf/benchmark.ts @@ -0,0 +1,26 @@ +import { withCodSpeed } from '@codspeed/tinybench-plugin'; +import { Bench } from 'tinybench'; +import { PerformanceTest } from './PerformanceTest'; +import { makeTests } from './tests'; + +const bench = withCodSpeed(new Bench({ + warmupIterations: 1, + iterations: 3, +})); +const dimension = 256; +const scope = 'all'; + +for (const test of makeTests(true)) { + if (test.name !== 'N3Store') { + bench.add(test.name, async() => { + await new PerformanceTest([ test ], dimension).run(scope); + }); + } +} + +// eslint-disable-next-line @typescript-eslint/no-floating-promises +(async function() { + await bench.run(); + // eslint-disable-next-line no-console + console.table(bench.table()); +})(); diff --git a/perf/run.ts b/perf/run.ts index 86da59f..8a61c2b 100644 --- a/perf/run.ts +++ b/perf/run.ts @@ -1,21 +1,6 @@ -import { DataFactory } from 'rdf-data-factory'; import { hideBin } from 'yargs/helpers'; -import { TermDictionaryNumberMap } from '../lib/dictionary/TermDictionaryNumberMap'; -import { TermDictionaryNumberRecord } from '../lib/dictionary/TermDictionaryNumberRecord'; -import { TermDictionaryNumberRecordFullTerms } from '../lib/dictionary/TermDictionaryNumberRecordFullTerms'; -import { TermDictionaryQuoted } from '../lib/dictionary/TermDictionaryQuoted'; -import { TermDictionaryQuotedIndexed } from '../lib/dictionary/TermDictionaryQuotedIndexed'; -import { TermDictionaryQuotedReferential } from '../lib/dictionary/TermDictionaryQuotedReferential'; -import { TermDictionarySymbol } from '../lib/dictionary/TermDictionarySymbol'; -import { RdfStoreIndexNestedMap } from '../lib/index/RdfStoreIndexNestedMap'; -import { RdfStoreIndexNestedMapQuoted } from '../lib/index/RdfStoreIndexNestedMapQuoted'; -import { RdfStoreIndexNestedMapRecursive } from '../lib/index/RdfStoreIndexNestedMapRecursive'; -import { RdfStoreIndexNestedMapRecursiveQuoted } from '../lib/index/RdfStoreIndexNestedMapRecursiveQuoted'; -import { RdfStoreIndexNestedRecord } from '../lib/index/RdfStoreIndexNestedRecord'; -import { RdfStoreIndexNestedRecordQuoted } from '../lib/index/RdfStoreIndexNestedRecordQuoted'; -import { RdfStore } from '../lib/RdfStore'; -import type { IPerformanceTestApproach } from './PerformanceTest'; import { PerformanceTest } from './PerformanceTest'; +import { makeTests } from './tests'; const argv = require('yargs/yargs')(hideBin(process.argv)) .options({ @@ -40,302 +25,6 @@ const argv = require('yargs/yargs')(hideBin(process.argv)) }, }).argv; -const test = new PerformanceTest([ - ...!argv.optimal ? - [ - { - name: '1 Record index (Map)', - options: { - type: 'rdfstore', - options: { - indexCombinations: [[ 'graph', 'subject', 'predicate', 'object' ]], - indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions), - dictionary: new TermDictionaryNumberMap(), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '3 Record indexes (Map)', - options: { - type: 'rdfstore', - options: { - indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, - indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions), - dictionary: new TermDictionaryNumberMap(), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '1 Record index (Record)', - options: { - type: 'rdfstore', - options: { - indexCombinations: [[ 'graph', 'subject', 'predicate', 'object' ]], - indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions), - dictionary: new TermDictionaryNumberRecord(), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '3 Record indexes (Record)', - options: { - type: 'rdfstore', - options: { - indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, - indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions), - dictionary: new TermDictionaryNumberRecord(), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '1 Record index (Record FT)', - options: { - type: 'rdfstore', - options: { - indexCombinations: [[ 'graph', 'subject', 'predicate', 'object' ]], - indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions), - dictionary: new TermDictionaryNumberRecordFullTerms(), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '3 Record indexes (Record FT)', - options: { - type: 'rdfstore', - options: { - indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, - indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions), - dictionary: new TermDictionaryNumberRecordFullTerms(), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '1 Map index (Map)', - options: { - type: 'rdfstore', - options: { - indexCombinations: [[ 'graph', 'subject', 'predicate', 'object' ]], - indexConstructor: subOptions => new RdfStoreIndexNestedMap(subOptions), - dictionary: new TermDictionaryNumberMap(), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '3 Map indexes (Map)', - options: { - type: 'rdfstore', - options: { - indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, - indexConstructor: subOptions => new RdfStoreIndexNestedMap(subOptions), - dictionary: new TermDictionaryNumberMap(), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '1 Map index recursive (Map)', - options: { - type: 'rdfstore', - options: { - indexCombinations: [[ 'graph', 'subject', 'predicate', 'object' ]], - indexConstructor: subOptions => new RdfStoreIndexNestedMapRecursive(subOptions), - dictionary: new TermDictionaryNumberMap(), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '3 Map indexes recursive (Map)', - options: { - type: 'rdfstore', - options: { - indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, - indexConstructor: subOptions => new RdfStoreIndexNestedMapRecursive(subOptions), - dictionary: new TermDictionaryNumberMap(), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '1 Map index (symbol)', - options: { - type: 'rdfstore', - options: { - indexCombinations: [[ 'graph', 'subject', 'predicate', 'object' ]], - indexConstructor: subOptions => new RdfStoreIndexNestedMap(subOptions), - dictionary: new TermDictionarySymbol(), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '3 Map indexes (symbol)', - options: { - type: 'rdfstore', - options: { - indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, - indexConstructor: subOptions => new RdfStoreIndexNestedMap(subOptions), - dictionary: new TermDictionarySymbol(), - dataFactory: new DataFactory(), - }, - }, - }, - - // Quoted triples approaches - { - name: '3 Nested Map Recursive Quoted indexes with indexed quoted dict (number)', - options: { - type: 'rdfstore', - options: { - indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, - indexConstructor: subOptions => new RdfStoreIndexNestedMapRecursiveQuoted(subOptions), - dictionary: new TermDictionaryQuotedIndexed(new TermDictionaryNumberRecordFullTerms(), new DataFactory()), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '3 Nested Map Quoted indexes with separated quoted dict (number)', - options: { - type: 'rdfstore', - options: { - indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, - indexConstructor: subOptions => new RdfStoreIndexNestedMapQuoted(subOptions), - dictionary: new TermDictionaryQuoted( - new TermDictionaryNumberRecordFullTerms(), - new TermDictionaryNumberRecordFullTerms(), - ), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '3 Nested Record Quoted indexes with separated quoted dict (number)', - options: { - type: 'rdfstore', - options: { - indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, - indexConstructor: subOptions => new RdfStoreIndexNestedRecordQuoted(subOptions), - dictionary: new TermDictionaryQuoted( - new TermDictionaryNumberRecordFullTerms(), - new TermDictionaryNumberRecordFullTerms(), - ), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '3 Nested Map Quoted indexes with separated referential quoted dict (number)', - options: { - type: 'rdfstore', - options: { - indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, - indexConstructor: subOptions => new RdfStoreIndexNestedMapQuoted(subOptions), - dictionary: new TermDictionaryQuotedReferential(new TermDictionaryNumberRecordFullTerms()), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '3 Nested Record Quoted indexes with separated referential quoted dict (number)', - options: { - type: 'rdfstore', - options: { - indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, - indexConstructor: subOptions => new RdfStoreIndexNestedRecordQuoted(subOptions), - dictionary: new TermDictionaryQuotedReferential(new TermDictionaryNumberRecordFullTerms()), - dataFactory: new DataFactory(), - }, - }, - }, - ] : - [], - - { - name: 'N3Store', - options: { - type: 'n3', - }, - }, - { - name: '3 Map indexes (number) OPT-QUERY', - options: { - type: 'rdfstore', - options: { - indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, - indexConstructor: subOptions => new RdfStoreIndexNestedMap(subOptions), - dictionary: new TermDictionaryNumberRecordFullTerms(), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '3 Record indexes (number) OPT-INGEST', - options: { - type: 'rdfstore', - options: { - indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, - indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions), - dictionary: new TermDictionaryNumberRecordFullTerms(), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '1 Map indexes (number) OPT-QUERY', - options: { - type: 'rdfstore', - options: { - indexCombinations: [[ 'graph', 'subject', 'predicate', 'object' ]], - indexConstructor: subOptions => new RdfStoreIndexNestedMap(subOptions), - dictionary: new TermDictionaryNumberRecordFullTerms(), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '1 Record indexes (number) OPT-INGEST', - options: { - type: 'rdfstore', - options: { - indexCombinations: [[ 'graph', 'subject', 'predicate', 'object' ]], - indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions), - dictionary: new TermDictionaryNumberRecordFullTerms(), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '3 Nested Map Quoted indexes with indexed quoted dict (number) OPT-QUERY', - options: { - type: 'rdfstore', - options: { - indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, - indexConstructor: subOptions => new RdfStoreIndexNestedMapQuoted(subOptions), - dictionary: new TermDictionaryQuotedIndexed(new TermDictionaryNumberRecordFullTerms(), new DataFactory()), - dataFactory: new DataFactory(), - }, - }, - }, - { - name: '3 Nested Record Quoted indexes with indexed quoted dict (number) OPT-INGEST', - options: { - type: 'rdfstore', - options: { - indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, - indexConstructor: subOptions => new RdfStoreIndexNestedRecordQuoted(subOptions), - dictionary: new TermDictionaryQuotedIndexed(new TermDictionaryNumberRecordFullTerms(), new DataFactory()), - dataFactory: new DataFactory(), - }, - }, - }, -], argv.dimension); +const test = new PerformanceTest(makeTests(argv.optimal), argv.dimension); // eslint-disable-next-line @typescript-eslint/no-floating-promises test.run(argv.tests); diff --git a/perf/tests.ts b/perf/tests.ts new file mode 100644 index 0000000..961fbd7 --- /dev/null +++ b/perf/tests.ts @@ -0,0 +1,316 @@ +import { DataFactory } from 'rdf-data-factory'; +import { TermDictionaryNumberMap } from '../lib/dictionary/TermDictionaryNumberMap'; +import { TermDictionaryNumberRecord } from '../lib/dictionary/TermDictionaryNumberRecord'; +import { TermDictionaryNumberRecordFullTerms } from '../lib/dictionary/TermDictionaryNumberRecordFullTerms'; +import { TermDictionaryQuoted } from '../lib/dictionary/TermDictionaryQuoted'; +import { TermDictionaryQuotedIndexed } from '../lib/dictionary/TermDictionaryQuotedIndexed'; +import { TermDictionaryQuotedReferential } from '../lib/dictionary/TermDictionaryQuotedReferential'; +import { TermDictionarySymbol } from '../lib/dictionary/TermDictionarySymbol'; +import { RdfStoreIndexNestedMap } from '../lib/index/RdfStoreIndexNestedMap'; +import { RdfStoreIndexNestedMapQuoted } from '../lib/index/RdfStoreIndexNestedMapQuoted'; +import { RdfStoreIndexNestedMapRecursive } from '../lib/index/RdfStoreIndexNestedMapRecursive'; +import { RdfStoreIndexNestedMapRecursiveQuoted } from '../lib/index/RdfStoreIndexNestedMapRecursiveQuoted'; +import { RdfStoreIndexNestedRecord } from '../lib/index/RdfStoreIndexNestedRecord'; +import { RdfStoreIndexNestedRecordQuoted } from '../lib/index/RdfStoreIndexNestedRecordQuoted'; +import { RdfStore } from '../lib/RdfStore'; +import type { IPerformanceTestApproach } from './PerformanceTest'; + +export function makeTests(optimal: boolean): IPerformanceTestApproach[] { + return [ + ...!optimal ? + [ + { + name: '1 Record index (Map)', + options: { + type: 'rdfstore', + options: { + indexCombinations: [[ 'graph', 'subject', 'predicate', 'object' ]], + indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions), + dictionary: new TermDictionaryNumberMap(), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '3 Record indexes (Map)', + options: { + type: 'rdfstore', + options: { + indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, + indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions), + dictionary: new TermDictionaryNumberMap(), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '1 Record index (Record)', + options: { + type: 'rdfstore', + options: { + indexCombinations: [[ 'graph', 'subject', 'predicate', 'object' ]], + indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions), + dictionary: new TermDictionaryNumberRecord(), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '3 Record indexes (Record)', + options: { + type: 'rdfstore', + options: { + indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, + indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions), + dictionary: new TermDictionaryNumberRecord(), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '1 Record index (Record FT)', + options: { + type: 'rdfstore', + options: { + indexCombinations: [[ 'graph', 'subject', 'predicate', 'object' ]], + indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions), + dictionary: new TermDictionaryNumberRecordFullTerms(), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '3 Record indexes (Record FT)', + options: { + type: 'rdfstore', + options: { + indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, + indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions), + dictionary: new TermDictionaryNumberRecordFullTerms(), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '1 Map index (Map)', + options: { + type: 'rdfstore', + options: { + indexCombinations: [[ 'graph', 'subject', 'predicate', 'object' ]], + indexConstructor: subOptions => new RdfStoreIndexNestedMap(subOptions), + dictionary: new TermDictionaryNumberMap(), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '3 Map indexes (Map)', + options: { + type: 'rdfstore', + options: { + indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, + indexConstructor: subOptions => new RdfStoreIndexNestedMap(subOptions), + dictionary: new TermDictionaryNumberMap(), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '1 Map index recursive (Map)', + options: { + type: 'rdfstore', + options: { + indexCombinations: [[ 'graph', 'subject', 'predicate', 'object' ]], + indexConstructor: subOptions => new RdfStoreIndexNestedMapRecursive(subOptions), + dictionary: new TermDictionaryNumberMap(), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '3 Map indexes recursive (Map)', + options: { + type: 'rdfstore', + options: { + indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, + indexConstructor: subOptions => new RdfStoreIndexNestedMapRecursive(subOptions), + dictionary: new TermDictionaryNumberMap(), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '1 Map index (symbol)', + options: { + type: 'rdfstore', + options: { + indexCombinations: [[ 'graph', 'subject', 'predicate', 'object' ]], + indexConstructor: subOptions => new RdfStoreIndexNestedMap(subOptions), + dictionary: new TermDictionarySymbol(), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '3 Map indexes (symbol)', + options: { + type: 'rdfstore', + options: { + indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, + indexConstructor: subOptions => new RdfStoreIndexNestedMap(subOptions), + dictionary: new TermDictionarySymbol(), + dataFactory: new DataFactory(), + }, + }, + }, + + // Quoted triples approaches + { + name: '3 Nested Map Recursive Quoted indexes with indexed quoted dict (number)', + options: { + type: 'rdfstore', + options: { + indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, + indexConstructor: subOptions => new RdfStoreIndexNestedMapRecursiveQuoted(subOptions), + dictionary: new TermDictionaryQuotedIndexed(new TermDictionaryNumberRecordFullTerms(), new DataFactory()), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '3 Nested Map Quoted indexes with separated quoted dict (number)', + options: { + type: 'rdfstore', + options: { + indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, + indexConstructor: subOptions => new RdfStoreIndexNestedMapQuoted(subOptions), + dictionary: new TermDictionaryQuoted( + new TermDictionaryNumberRecordFullTerms(), + new TermDictionaryNumberRecordFullTerms(), + ), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '3 Nested Record Quoted indexes with separated quoted dict (number)', + options: { + type: 'rdfstore', + options: { + indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, + indexConstructor: subOptions => new RdfStoreIndexNestedRecordQuoted(subOptions), + dictionary: new TermDictionaryQuoted( + new TermDictionaryNumberRecordFullTerms(), + new TermDictionaryNumberRecordFullTerms(), + ), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '3 Nested Map Quoted indexes with separated referential quoted dict (number)', + options: { + type: 'rdfstore', + options: { + indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, + indexConstructor: subOptions => new RdfStoreIndexNestedMapQuoted(subOptions), + dictionary: new TermDictionaryQuotedReferential(new TermDictionaryNumberRecordFullTerms()), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '3 Nested Record Quoted indexes with separated referential quoted dict (number)', + options: { + type: 'rdfstore', + options: { + indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, + indexConstructor: subOptions => new RdfStoreIndexNestedRecordQuoted(subOptions), + dictionary: new TermDictionaryQuotedReferential(new TermDictionaryNumberRecordFullTerms()), + dataFactory: new DataFactory(), + }, + }, + }, + ] : + [], + + { + name: 'N3Store', + options: { + type: 'n3', + }, + }, + { + name: '3 Map indexes (number) OPT-QUERY', + options: { + type: 'rdfstore', + options: { + indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, + indexConstructor: subOptions => new RdfStoreIndexNestedMap(subOptions), + dictionary: new TermDictionaryNumberRecordFullTerms(), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '3 Record indexes (number) OPT-INGEST', + options: { + type: 'rdfstore', + options: { + indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, + indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions), + dictionary: new TermDictionaryNumberRecordFullTerms(), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '1 Map indexes (number) OPT-QUERY', + options: { + type: 'rdfstore', + options: { + indexCombinations: [[ 'graph', 'subject', 'predicate', 'object' ]], + indexConstructor: subOptions => new RdfStoreIndexNestedMap(subOptions), + dictionary: new TermDictionaryNumberRecordFullTerms(), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '1 Record indexes (number) OPT-INGEST', + options: { + type: 'rdfstore', + options: { + indexCombinations: [[ 'graph', 'subject', 'predicate', 'object' ]], + indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions), + dictionary: new TermDictionaryNumberRecordFullTerms(), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '3 Nested Map Quoted indexes with indexed quoted dict (number) OPT-QUERY', + options: { + type: 'rdfstore', + options: { + indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, + indexConstructor: subOptions => new RdfStoreIndexNestedMapQuoted(subOptions), + dictionary: new TermDictionaryQuotedIndexed(new TermDictionaryNumberRecordFullTerms(), new DataFactory()), + dataFactory: new DataFactory(), + }, + }, + }, + { + name: '3 Nested Record Quoted indexes with indexed quoted dict (number) OPT-INGEST', + options: { + type: 'rdfstore', + options: { + indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS, + indexConstructor: subOptions => new RdfStoreIndexNestedRecordQuoted(subOptions), + dictionary: new TermDictionaryQuotedIndexed(new TermDictionaryNumberRecordFullTerms(), new DataFactory()), + dataFactory: new DataFactory(), + }, + }, + }, + ]; +} diff --git a/yarn.lock b/yarn.lock index d5d278c..a1f1f78 100644 --- a/yarn.lock +++ b/yarn.lock @@ -314,6 +314,24 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@codspeed/core@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@codspeed/core/-/core-3.1.0.tgz#1a2ac93ce1ed7ae5e74ba253327939d857db6329" + integrity sha512-oYd7X46QhnRkgRbZkqAoX9i3Fwm17FpunK4Ee5RdrvRYR0Xr93ewH8/O5g6uyTPDOOqDEv1v2KRYtWhVgN+2VQ== + dependencies: + axios "^1.4.0" + find-up "^6.3.0" + form-data "^4.0.0" + node-gyp-build "^4.6.0" + +"@codspeed/tinybench-plugin@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@codspeed/tinybench-plugin/-/tinybench-plugin-3.1.0.tgz#059427f740514bf82ca8105ef420485db841dcab" + integrity sha512-yl0WzzUGIXkZzWaw7+2U+xGkuIal1Rs9hS09DtlDZGGAcGRoMMU5d2vyCS8nBrna4hrPQZ5Sx/hIKerO+lqWaw== + dependencies: + "@codspeed/core" "^3.1.0" + stack-trace "1.0.0-pre2" + "@eslint/eslintrc@^0.4.3": version "0.4.3" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" @@ -1205,6 +1223,15 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== +axios@^1.4.0: + version "1.6.8" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66" + integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ== + dependencies: + follow-redirects "^1.15.6" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + babel-jest@^29.4.1: version "29.4.1" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.4.1.tgz#01fa167e27470b35c2d4a1b841d9586b1764da19" @@ -1472,7 +1499,7 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -combined-stream@^1.0.6, combined-stream@~1.0.6: +combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -2241,6 +2268,14 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" +find-up@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-6.3.0.tgz#2abab3d3280b2dc7ac10199ef324c4e002c8c790" + integrity sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw== + dependencies: + locate-path "^7.1.0" + path-exists "^5.0.0" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -2254,6 +2289,11 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== +follow-redirects@^1.15.6: + version "1.15.6" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -2266,6 +2306,15 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -3324,6 +3373,13 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +locate-path@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-7.2.0.tgz#69cb1779bd90b35ab1e771e1f2f89a202c2a8a8a" + integrity sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA== + dependencies: + p-locate "^6.0.0" + lodash.memoize@4.x: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" @@ -3539,6 +3595,11 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== +node-gyp-build@^4.6.0: + version "4.8.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.0.tgz#3fee9c1731df4581a3f9ead74664369ff00d26dd" + integrity sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og== + node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -3691,6 +3752,13 @@ p-limit@^3.1.0: dependencies: yocto-queue "^0.1.0" +p-limit@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-4.0.0.tgz#914af6544ed32bfa54670b061cafcbd04984b644" + integrity sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ== + dependencies: + yocto-queue "^1.0.0" + p-locate@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" @@ -3698,6 +3766,13 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" +p-locate@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-6.0.0.tgz#3da9a49d4934b901089dca3302fa65dc5a05c04f" + integrity sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw== + dependencies: + p-limit "^4.0.0" + p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" @@ -3725,6 +3800,11 @@ path-exists@^4.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== +path-exists@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-5.0.0.tgz#a6aad9489200b21fab31e49cf09277e5116fb9e7" + integrity sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ== + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -3832,6 +3912,11 @@ prop-types@^15.7.2, prop-types@^15.8.1: object-assign "^4.1.1" react-is "^16.13.1" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" @@ -4278,6 +4363,11 @@ sshpk@^1.7.0: safer-buffer "^2.0.2" tweetnacl "~0.14.0" +stack-trace@1.0.0-pre2: + version "1.0.0-pre2" + resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-1.0.0-pre2.tgz#46a83a79f1b287807e9aaafc6a5dd8bcde626f9c" + integrity sha512-2ztBJRek8IVofG9DBJqdy2N5kulaacX30Nz7xmkYF6ale9WBVmIy6mFBchvGX7Vx/MyjBhx+Rcxqrj+dbOnQ6A== + stack-utils@^2.0.3: version "2.0.6" resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" @@ -4453,6 +4543,11 @@ through2@^4.0.0: dependencies: readable-stream "3" +tinybench@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.8.0.tgz#30e19ae3a27508ee18273ffed9ac7018949acd7b" + integrity sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw== + tmpl@1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" @@ -4814,3 +4909,8 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +yocto-queue@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" + integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==