2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-06-20 20:00:33 +03:00

chore(benchmark): update benchmark resulting info

This commit is contained in:
Nikolay Kostyurin
2019-03-29 10:35:11 +02:00
parent e4b38f289f
commit dd0056f2b9
+11 -14
View File
@@ -3,14 +3,13 @@ const stub = require('./test/stub');
const suite = new Benchmark.Suite(); const suite = new Benchmark.Suite();
// add tests
suite suite
.add('Regex Based Parser', () => { .add('regex/parser', () => require('./test/RegexParser').parse(stub, {
const RegexParser = require('./test/RegexParser'); ch: {
closable: true,
const result = RegexParser.parse(stub); },
}) }))
.add('xBBCode Parser', () => { .add('xbbcode/parser', () => {
const xbbcode = require('xbbcode-parser'); const xbbcode = require('xbbcode-parser');
xbbcode.addTags({ xbbcode.addTags({
ch: { ch: {
@@ -24,17 +23,15 @@ suite
}, },
}); });
const result = xbbcode.process({ return xbbcode.process({
text: stub, text: stub,
removeMisalignedTags: false, removeMisalignedTags: false,
addInLineBreaks: false, addInLineBreaks: false,
}); });
}) })
.add('BBob Parser', () => { .add('@bbob/parser', () => require('../packages/bbob-parser/lib/index').parse(stub, {
const parse = require('../packages/bbob-parser/lib/index').parse; onlyAllowTags: ['ch'],
}))
const result = parse(stub);
})
// add listeners // add listeners
.on('cycle', (event) => { .on('cycle', (event) => {
console.log(String(event.target)); console.log(String(event.target));
@@ -43,4 +40,4 @@ suite
console.log(`Fastest is ${this.filter('fastest').map('name')}`); console.log(`Fastest is ${this.filter('fastest').map('name')}`);
}) })
// run async // run async
.run({ async: true }); .run({ async: false });