Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: reorganize benchmarks #13606

Merged
merged 2 commits into from Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,8 +1,8 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/generator";
import current from "../../lib/index.js";
import current from "@babel/generator";
import parser from "@babel/parser";
import { report } from "../util.mjs";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();

Expand Down
@@ -1,8 +1,8 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/generator";
import current from "../../lib/index.js";
import current from "@babel/generator";
import parser from "@babel/parser";
import { report } from "../util.mjs";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();

Expand Down
@@ -1,8 +1,8 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/generator";
import current from "../../lib/index.js";
import current from "@babel/generator";
import parser from "@babel/parser";
import { report } from "../util.mjs";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();

Expand Down
@@ -1,8 +1,8 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/generator";
import current from "../../lib/index.js";
import current from "@babel/generator";
import parser from "@babel/parser";
import { report } from "../util.mjs";
import { report } from "../../util.mjs";
import { readFileSync } from "fs";

const suite = new Benchmark.Suite();
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel/helper-validator-identifier-baseline";
import current from "../lib/index.js";
import { report } from "./util.mjs";
import baseline from "@babel-baseline/helper-validator-identifier";
import current from "@babel/helper-validator-identifier";
import { report } from "../util.mjs";

const suite = new Benchmark.Suite();

Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel/helper-validator-identifier-baseline";
import current from "../lib/index.js";
import { report } from "./util.mjs";
import baseline from "@babel-baseline/helper-validator-identifier";
import current from "@babel/helper-validator-identifier";
import { report } from "../util.mjs";

const suite = new Benchmark.Suite();

Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel/helper-validator-identifier-baseline";
import current from "../lib/index.js";
import { report } from "./util.mjs";
import baseline from "@babel-baseline/helper-validator-identifier";
import current from "@babel/helper-validator-identifier";
import { report } from "../util.mjs";

const suite = new Benchmark.Suite();

Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel/helper-validator-identifier-baseline";
import current from "../lib/index.js";
import { report } from "./util.mjs";
import baseline from "@babel-baseline/helper-validator-identifier";
import current from "@babel/helper-validator-identifier";
import { report } from "../util.mjs";

const suite = new Benchmark.Suite();

Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel/helper-validator-identifier-baseline";
import current from "../lib/index.js";
import { report } from "./util.mjs";
import baseline from "@babel-baseline/helper-validator-identifier";
import current from "@babel/helper-validator-identifier";
import { report } from "../util.mjs";

const suite = new Benchmark.Suite();

Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/parser";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
function createInput(length) {
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/parser";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
function createInput(length) {
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/parser";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
function createInput(length) {
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/parser";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
// All codepoints in [0x4e00, 0x9ffc] are valid identifier name per Unicode 13
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/parser";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();

Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/parser";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
function createInput(length) {
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "../../lib/index-main.js";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
function createInput(length) {
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/parser";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
function createInput(length) {
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "../../lib/index-main.js";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
function createInput(length) {
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/parser";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
function createInput(length) {
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/parser";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
function createInput(length) {
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/parser";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
function createInput(length) {
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/parser";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
function createInput(length) {
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/parser";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
function createInput(length) {
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/parser";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
function createInput(length) {
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/parser";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
// All codepoints in [0x4e00, 0x9ffc] are valid identifier name per Unicode 13
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/parser";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
// All codepoints in [0x4e00, 0x9ffc] are valid identifier name per Unicode 13
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "../../lib/index-v2.js";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
function createInput(length) {
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/parser";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
function createInput(length) {
Expand Down
@@ -1,7 +1,7 @@
import Benchmark from "benchmark";
import baseline from "@babel-baseline/parser";
import current from "../../lib/index.js";
import { report } from "../util.mjs";
import current from "@babel/parser";
import { report } from "../../util.mjs";

const suite = new Benchmark.Suite();
function createInput(length) {
Expand Down
14 changes: 14 additions & 0 deletions benchmark/package.json
@@ -0,0 +1,14 @@
{
"name": "@babel/benchmark",
"private": true,
"type": "module",
"devDependencies": {
"@babel-baseline/generator": "npm:@babel/generator@7.14.5",
"@babel-baseline/helper-validator-identifier": "npm:@babel/helper-validator-identifier@7.10.4",
"@babel-baseline/parser": "npm:@babel/parser@7.14.5",
"@babel/generator": "workspace:*",
"@babel/helper-validator-identifier": "workspace:*",
"@babel/parser": "workspace:*",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we can compare performances between any versions of babel packages by revising this package.json.

Copy link

@KFlash KFlash Jul 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the perf diff between Rome and ESbuild vs Babel? Equal in performance?

"benchmark": "^2.1.4"
}
}
File renamed without changes.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -75,7 +75,8 @@
"eslint/*",
"packages/*",
"test/esm",
"test/runtime-integration/*"
"test/runtime-integration/*",
"benchmark"
],
"resolutions": {
"browserslist": "npm:4.16.6",
Expand Down
2 changes: 0 additions & 2 deletions packages/babel-generator/package.json
Expand Up @@ -24,12 +24,10 @@
"source-map": "^0.5.0"
},
"devDependencies": {
"@babel-baseline/generator": "npm:@babel/generator@7.14.5",
"@babel/helper-fixtures": "workspace:*",
"@babel/parser": "workspace:*",
"@types/jsesc": "^2.5.0",
"@types/source-map": "^0.5.0",
"benchmark": "^2.1.4",
"charcodes": "^0.2.0"
},
"engines": {
Expand Down
1 change: 0 additions & 1 deletion packages/babel-helper-validator-identifier/.npmignore
@@ -1,4 +1,3 @@
benchmark
src
test
*.log
17 changes: 0 additions & 17 deletions packages/babel-helper-validator-identifier/benchmark/util.mjs

This file was deleted.

2 changes: 0 additions & 2 deletions packages/babel-helper-validator-identifier/package.json
Expand Up @@ -14,9 +14,7 @@
"main": "./lib/index.js",
"exports": "./lib/index.js",
"devDependencies": {
"@babel/helper-validator-identifier-baseline": "npm:@babel/helper-validator-identifier@7.10.4",
"@unicode/unicode-13.0.0": "^1.0.6",
"benchmark": "^2.1.4",
"charcodes": "^0.2.0"
},
"engines": {
Expand Down
17 changes: 0 additions & 17 deletions packages/babel-parser/benchmark/util.mjs

This file was deleted.

2 changes: 0 additions & 2 deletions packages/babel-parser/package.json
Expand Up @@ -33,11 +33,9 @@
"node": ">=6.0.0"
},
"devDependencies": {
"@babel-baseline/parser": "npm:@babel/parser@^7.14.5",
"@babel/code-frame": "workspace:*",
"@babel/helper-fixtures": "workspace:*",
"@babel/helper-validator-identifier": "workspace:*",
"benchmark": "^2.1.4",
"charcodes": "^0.2.0"
},
"bin": "./bin/babel-parser.js"
Expand Down