Update benchmark paths

master
Futago-za Ryuu 5 years ago
parent 53b966289b
commit 0253215c24

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

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

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

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

@ -85,7 +85,7 @@ const Runner = {
callbacks.testStart( benchmark, test ); 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; let parseTime = 0;
for ( let i = 0; i < runCount; i++ ) { for ( let i = 0; i < runCount; i++ ) {

Loading…
Cancel
Save