cleaner approach
This commit is contained in:
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"evalConfig": {
|
|
||||||
"tolerance": {
|
|
||||||
"*": [0.75, 1.5],
|
|
||||||
"*.dev": [0.01, 1.5],
|
|
||||||
"*.cv": [0.01, 1.5],
|
|
||||||
"EscapeSequenceParser.benchmark.js.*.averageThroughput.mean": [0.9, 5]
|
|
||||||
},
|
|
||||||
"skip": [
|
|
||||||
"*.median",
|
|
||||||
"*.runs",
|
|
||||||
"*.dev",
|
|
||||||
"*.cv",
|
|
||||||
"EscapeSequenceParser.benchmark.js.*.averageRuntime",
|
|
||||||
"Terminal.benchmark.js.*.averageRuntime"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"lib": [
|
|
||||||
"dom",
|
|
||||||
"es6",
|
|
||||||
],
|
|
||||||
"rootDir": ".",
|
|
||||||
"outDir": "../benchmark",
|
|
||||||
"types": [
|
|
||||||
"../node_modules/@types/node"
|
|
||||||
],
|
|
||||||
"sourceMap": true,
|
|
||||||
"removeComments": true,
|
|
||||||
"pretty": true,
|
|
||||||
"strict": true,
|
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
|
||||||
"common/*": [ "./../out/common/*" ],
|
|
||||||
"browser/*": [ "./../out/browser/*" ]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"./**/*",
|
|
||||||
"../typings/xterm.d.ts"
|
|
||||||
],
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
|
|
||||||
* @license MIT
|
|
||||||
*/
|
|
||||||
|
|
||||||
const cp = require('child_process');
|
|
||||||
const path = require('path');
|
|
||||||
const glob = require('glob');
|
|
||||||
|
|
||||||
// Add `out` to the NODE_PATH so absolute paths can be resolved.
|
|
||||||
const env = { ...process.env };
|
|
||||||
env.NODE_PATH = path.resolve(__dirname, '../out');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default commands for yarn:
|
|
||||||
* yarn benchmark single single run of all benchmarks without statistics
|
|
||||||
* yarn benchmark baseline 10 runs of all benchmarks with baseline statistics
|
|
||||||
* yarn benchmark eval 10 runs of all benchmarks with eval against last baseline
|
|
||||||
*/
|
|
||||||
const commands = {
|
|
||||||
single : '-r 5 -c ./benchmark-tests/benchmark.json',
|
|
||||||
baseline: '--baseline -r 5 -c ./benchmark-tests/benchmark.json',
|
|
||||||
eval : '--eval -r 5 -c ./benchmark-tests/benchmark.json'
|
|
||||||
}
|
|
||||||
|
|
||||||
let testFiles = [
|
|
||||||
'./benchmark/*benchmark.js'
|
|
||||||
];
|
|
||||||
|
|
||||||
// allow overriding cmdline args (see yarn benchmark --help)
|
|
||||||
if (process.argv.length === 3 && process.argv[2] in commands) {
|
|
||||||
testFiles.push(commands[process.argv[2]]);
|
|
||||||
} else if (process.argv.length > 2) {
|
|
||||||
testFiles = process.argv.slice(2);
|
|
||||||
} else if (process.argv.length === 2) {
|
|
||||||
testFiles.push(commands['single']);
|
|
||||||
}
|
|
||||||
|
|
||||||
cp.spawnSync(
|
|
||||||
path.resolve(__dirname, '../node_modules/.bin/xterm-benchmark'),
|
|
||||||
testFiles.reduce((accu, cur) => {
|
|
||||||
const expanded = glob.sync(cur);
|
|
||||||
if (!expanded.length) {
|
|
||||||
accu.push(cur);
|
|
||||||
return accu;
|
|
||||||
}
|
|
||||||
return accu.concat(expanded);
|
|
||||||
}, []),
|
|
||||||
{
|
|
||||||
cwd: path.resolve(__dirname, '..'),
|
|
||||||
env,
|
|
||||||
stdio: 'inherit',
|
|
||||||
shell: true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
+3
-1
@@ -20,7 +20,9 @@
|
|||||||
"prepublishOnly": "npm run package",
|
"prepublishOnly": "npm run package",
|
||||||
"watch": "tsc -b -w ./tsconfig.all.json --preserveWatchOutput",
|
"watch": "tsc -b -w ./tsconfig.all.json --preserveWatchOutput",
|
||||||
"clean": "rm -rf lib out addons/*/lib",
|
"clean": "rm -rf lib out addons/*/lib",
|
||||||
"benchmark": "node ./bin/benchmark.js"
|
"benchmark": "NODE_PATH=./out xterm-benchmark -r 5 -c benchmark.json",
|
||||||
|
"benchmark-baseline": "NODE_PATH=./out xterm-benchmark -r 5 -c benchmark.json --baseline out/benchmark-tests/*benchmark.js",
|
||||||
|
"benchmark-eval": "NODE_PATH=./out xterm-benchmark -r 5 -c benchmark.json --eval out/benchmark-tests/*benchmark.js"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/chai": "^3.4.34",
|
"@types/chai": "^3.4.34",
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
export {};
|
||||||
+3
-3
@@ -4,9 +4,9 @@
|
|||||||
*/
|
*/
|
||||||
import { perfContext, before, beforeEach, ThroughputRuntimeCase } from 'xterm-benchmark';
|
import { perfContext, before, beforeEach, ThroughputRuntimeCase } from 'xterm-benchmark';
|
||||||
|
|
||||||
import { EscapeSequenceParser } from '../out/common/parser/EscapeSequenceParser';
|
import { EscapeSequenceParser } from 'common/parser/EscapeSequenceParser';
|
||||||
import { C0, C1 } from '../out/common/data/EscapeSequences';
|
import { C0, C1 } from 'common/data/EscapeSequences';
|
||||||
import { IDcsHandler } from '../out/common/parser/Types';
|
import { IDcsHandler } from 'common/parser/Types';
|
||||||
|
|
||||||
|
|
||||||
function toUtf32(s: string): Uint32Array {
|
function toUtf32(s: string): Uint32Array {
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
export {};
|
||||||
@@ -6,14 +6,10 @@
|
|||||||
import { perfContext, before, ThroughputRuntimeCase } from 'xterm-benchmark';
|
import { perfContext, before, ThroughputRuntimeCase } from 'xterm-benchmark';
|
||||||
|
|
||||||
import { spawn } from 'node-pty';
|
import { spawn } from 'node-pty';
|
||||||
import { Utf8ToUtf32, stringFromCodePoint } from '../out/common/input/TextDecoder';
|
import { Utf8ToUtf32, stringFromCodePoint } from 'common/input/TextDecoder';
|
||||||
|
import { Terminal } from 'Terminal';
|
||||||
const Terminal: any = require('../out/Terminal').Terminal;
|
|
||||||
|
|
||||||
class TestTerminal extends Terminal {
|
class TestTerminal extends Terminal {
|
||||||
constructor(opts: any) {
|
|
||||||
super(opts);
|
|
||||||
}
|
|
||||||
writeSync(data: string): void {
|
writeSync(data: string): void {
|
||||||
this.writeBuffer.push(data);
|
this.writeBuffer.push(data);
|
||||||
(this as any)._innerWrite();
|
(this as any)._innerWrite();
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig-library-base",
|
||||||
|
"compilerOptions": {
|
||||||
|
"lib": [
|
||||||
|
"dom",
|
||||||
|
"es6",
|
||||||
|
],
|
||||||
|
"outDir": "../../out",
|
||||||
|
"types": [
|
||||||
|
"../../node_modules/@types/node"
|
||||||
|
],
|
||||||
|
"baseUrl": "..",
|
||||||
|
"strict": false
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"./**/*",
|
||||||
|
"../**/*",
|
||||||
|
"../../typings/xterm.d.ts"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"../**/*test.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
+1
-3
@@ -8,8 +8,6 @@
|
|||||||
{ "path": "./addons/xterm-addon-fit/src" },
|
{ "path": "./addons/xterm-addon-fit/src" },
|
||||||
{ "path": "./addons/xterm-addon-search/src" },
|
{ "path": "./addons/xterm-addon-search/src" },
|
||||||
{ "path": "./addons/xterm-addon-web-links/src" },
|
{ "path": "./addons/xterm-addon-web-links/src" },
|
||||||
|
{ "path": "./src/benchmark-tests" },
|
||||||
// currently depends on out, thus must run as last?
|
|
||||||
{ "path": "./benchmark-tests" },
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user