Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions perf/bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ const deepTaxonomyBenchmark100 = [
...(new Parser({ format: 'n3' })).parse('{ ?s a ?o . ?o <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?o2 . } => { ?s a ?o2 . } .'),
]

const deepTaxonomyBenchmark1000 = [
...generateDeepTaxonomy(1000, true),
...(new Parser({ format: 'n3' })).parse('{ ?s a ?o . ?o <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?o2 . } => { ?s a ?o2 . } .'),
]

const deepTaxonomyBenchmark10000 = [
...generateDeepTaxonomy(10000, true),
...(new Parser({ format: 'n3' })).parse('{ ?s a ?o . ?o <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?o2 . } => { ?s a ?o2 . } .'),
]

function deferred(fn: () => Promise<any>): Benchmark.Options {
return {
defer: true,
Expand Down Expand Up @@ -63,6 +73,12 @@ async function main() {
).add(
'Run deep taxonomy benchmark [100]',
deferred(() => n3reasoner(deepTaxonomyBenchmark100)),
).add(
'Run deep taxonomy benchmark [1000]',
deferred(() => n3reasoner(deepTaxonomyBenchmark1000)),
).add(
'Run deep taxonomy benchmark [10000]',
deferred(() => n3reasoner(deepTaxonomyBenchmark10000)),
).on('cycle', (event: Event) => {
console.log(event.target.toString());
}).run();
Expand Down