Browse Source

Update benchmark paths

master
Futago-za Ryuu 3 years ago
parent
commit
0253215c24
  1. 2
      package.json
  2. 2
      tools/benchmark/README.md
  3. 5
      tools/benchmark/browser.stub.js
  4. 2
      tools/benchmark/index.js
  5. 2
      tools/benchmark/runner.js

2
package.json

@ -9,7 +9,7 @@
"scripts": {
"lint": "eslint --ext .js,.vue . docs/.vuepress",
"test": "nyc mocha --recursive",
"benchmark": "node tools/benchmark/node",
"benchmark": "node tools/benchmark",
"build-docs": "vuepress build docs",
"watch-docs": "vuepress dev docs",
"build-parser": "pegjs -c src/pegjs.config.js",

2
tools/benchmark/README.md

@ -3,5 +3,5 @@ This directory contains the benchmark suite that measures the speed of parsers g
From the root of the repository:
```sh
node tools/benchmark/node
node tools/benchmark
```

5
tools/benchmark/browser.js → tools/benchmark/browser.stub.js

@ -78,8 +78,6 @@ $( "#run" ).click( () => {
readFile( file ) {
if ( file.indexOf( "benchmark" ) === 0 ) file = "tools/" + file;
return $.ajax( {
type: "GET",
url: `https://raw.githubusercontent.com/pegjs/pegjs/${ BRANCH }/` + file,
@ -98,7 +96,8 @@ $( "#run" ).click( () => {
appendResult(
"individual",
test.title,
"benchmark/" + benchmark.id + "/" + test.file,
"tools/benchmark/" + benchmark.id + "/" + test.file,
`https://raw.githubusercontent.com/pegjs/pegjs/${ BRANCH }/tools/benchmark/${ benchmark.id }/${ test.file }`,
inputSize,
parseTime
);

2
tools/benchmark/node.js → tools/benchmark/index.js

@ -207,8 +207,6 @@ Runner.run( benchmarks, runCount, options, {
readFile( file ) {
if ( file.startsWith( "benchmark" ) ) file = path.join( "tools", file );
return fs.readFileSync( file, "utf8" );
},

2
tools/benchmark/runner.js

@ -85,7 +85,7 @@ const Runner = {
callbacks.testStart( benchmark, test );
const input = callbacks.readFile( "benchmark/" + benchmark.id + "/" + test.file );
const input = callbacks.readFile( "tools/benchmark/" + benchmark.id + "/" + test.file );
let parseTime = 0;
for ( let i = 0; i < runCount; i++ ) {

Loading…
Cancel
Save