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

Remove benchmarks from workspace #350

Merged
merged 1 commit into from
Dec 29, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ jobs:
run: npm ci

- name: Run benchmarks
run: npm run benchmarks --workspace=benchmarks
run: npm run bench
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ performance.

A benchmark utility is included so that changes may be tested against the
current published version. To run the benchmarks, run `npm install` in the
root directory then run `npm run benchmarks` in the `./benchmarks` directory.
root directory then run `npm run bench`.

Please be aware though that local benchmarks are just a smoke-signal; they will
run in the v8 version that your local Node.js uses, while classNames is _most_
often run across a wide variety of browsers and browser versions.

It is recommended to test possible regressions in performance in all major
browsers. This can be done by running `npm run benchmarks-browser` in the
`./benchmarks` directory, the benchmark will then be served from http://localhost:8080.
browsers. This can be done by running `npm run bench-browser`, the benchmark
will then be served from http://localhost:8080.
2 changes: 1 addition & 1 deletion benchmarks/benchmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import npmPackage from 'classnames-npm/package.json' with { type: 'json' };
if (localPackage.version !== npmPackage.version) {
console.warn(
`Your local version (${localPackage.version}) does not match the installed version (${npmPackage.version}).\n\n` +
'Please run `npm update classnames-npm` in ./benchmarks to ensure you are benchmarking against the latest version published to NPM.\n'
'Please run `npm update classnames-npm` to ensure you are benchmarking against the latest version published to NPM.\n'
);
}

Expand Down
20 changes: 1 addition & 19 deletions benchmarks/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1 @@
{
"name": "classnames-benchmarks",
"type": "module",
"scripts": {
"benchmarks": "node ./run.js",
"benchmarks-browser": "rollup --plugin commonjs,json,node-resolve ./runInBrowser.js --file ./runInBrowser.bundle.js && http-server -c-1"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"classnames-local": "file:../",
"classnames-npm": "npm:classnames@*",
"http-server": "^14.1.1",
"markdown-table": "^3.0.3",
"rollup": "^4.9.1",
"tinybench": "^2.5.1"
}
}
{"type": "module"}
18 changes: 3 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
},
"scripts": {
"test": "node --test ./tests/*.mjs",
"bench": "node ./benchmarks/run.js",
"bench-browser": "rollup --plugin commonjs,json,node-resolve ./benchmarks/runInBrowser.js --file ./benchmarks/runInBrowser.bundle.js && http-server -c-1 ./benchmarks",
"check-types": "tsd"
},
"keywords": [
Expand All @@ -58,10 +60,16 @@
"*.d.ts",
"*.js"
],
"workspaces": [
"benchmarks"
],
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"classnames-local": "file:.",
"classnames-npm": "npm:classnames@*",
"http-server": "^14.1.1",
"markdown-table": "^3.0.3",
"rollup": "^4.9.1",
"tinybench": "^2.5.1",
"tsd": "^0.30.1"
},
"tsd": {
Expand Down