File tree Expand file tree Collapse file tree 7 files changed +199
-2705
lines changed Expand file tree Collapse file tree 7 files changed +199
-2705
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,14 @@ performance.
12
12
[ JSPerf] ( http://jsperf.com ) test and link to it from your issue / PR.
13
13
* Tests must be added for any change or new feature before it will be accepted.
14
14
15
- A benchmark utilitiy is included so that changes may be tested against the
16
- current published version. To run the benchmarks, ` npm install ` in the
17
- ` ./benchmarks ` directory then run ` npm run benchmarks ` in the package root .
15
+ A benchmark utility is included so that changes may be tested against the
16
+ current published version. To run the benchmarks, run ` npm install ` in the
17
+ root directory then run ` npm run benchmarks ` in the ` ./benchmarks ` directory .
18
18
19
19
Please be aware though that local benchmarks are just a smoke-signal; they will
20
- run in the v8 version that your node/iojs uses, while classNames is _ most_
20
+ run in the v8 version that your local Node.js uses, while classNames is _ most_
21
21
often run across a wide variety of browsers and browser versions.
22
+
23
+ It is recommended to test possible regressions in performance in all major
24
+ browsers. This can be done by running ` npm run benchmarks-browserify ` in the
25
+ ` ./benchmarks ` directory.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " classnames-benchmarks" ,
3
- "version" : " 1.0.0" ,
4
- "private" : true ,
5
- "description" : " " ,
6
- "main" : " run.js" ,
7
3
"scripts" : {
8
- "test" : " echo \" Tests should be run in the main classnames package.\" && exit 1"
4
+ "benchmarks" : " node ./run.js" ,
5
+ "benchmarks-browserify" : " browserify ./runInBrowser.js >./runInBrowser.bundle.js"
9
6
},
10
- "author" : " Jed Watson" ,
11
- "license" : " MIT" ,
12
7
"devDependencies" : {
13
- "benchmark" : " 2.1.4" ,
14
- "classnames" : " *"
8
+ "benchmark" : " ^2.1.4" ,
9
+ "browserify" : " ^17.0.0" ,
10
+ "classnames-npm" : " npm:classnames@*" ,
11
+ "classnames-local" : " file:../"
15
12
}
16
13
}
Original file line number Diff line number Diff line change 1
1
var fixtures = require ( './fixtures' ) ;
2
- var local = require ( '../ ' ) ;
3
- var dedupe = require ( '.. /dedupe' ) ;
4
- var localPackage = require ( '.. /package.json' ) ;
2
+ var local = require ( 'classnames-local ' ) ;
3
+ var dedupe = require ( 'classnames-local /dedupe' ) ;
4
+ var localPackage = require ( 'classnames-local /package.json' ) ;
5
5
6
6
function log ( message ) {
7
7
console . log ( message ) ;
8
8
}
9
9
10
10
try {
11
- var npm = require ( 'classnames' ) ;
12
- var npmDedupe = require ( 'classnames/dedupe' ) ;
13
- var npmPackage = require ( './node_modules/ classnames/package.json' ) ;
11
+ var npm = require ( 'classnames-npm ' ) ;
12
+ var npmDedupe = require ( 'classnames-npm /dedupe' ) ;
13
+ var npmPackage = require ( 'classnames-npm /package.json' ) ;
14
14
} catch ( e ) {
15
15
log ( 'There was an error loading the benchmark classnames package.\n' +
16
16
'Please make sure you have run `npm install` in ./benchmarks\n' ) ;
19
19
20
20
if ( localPackage . version !== npmPackage . version ) {
21
21
log ( 'Your local version (' + localPackage . version + ') does not match the installed version (' + npmPackage . version + ')\n\n' +
22
- 'Please run `npm update` in ./benchmarks to ensure you are benchmarking\n' +
22
+ 'Please run `npm update classnames-npm ` in ./benchmarks to ensure you are benchmarking\n' +
23
23
'the latest version of this package.\n' ) ;
24
24
process . exit ( 0 ) ;
25
25
}
Original file line number Diff line number Diff line change 1
1
var fixtures = require ( './fixtures' ) ;
2
- var local = require ( '../ ' ) ;
3
- var dedupe = require ( '.. /dedupe' ) ;
4
- var localPackage = require ( '.. /package.json' ) ;
2
+ var local = require ( 'classnames-local ' ) ;
3
+ var dedupe = require ( 'classnames-local /dedupe' ) ;
4
+ var localPackage = require ( 'classnames-local /package.json' ) ;
5
5
6
- var npm = require ( 'classnames' ) ;
7
- var npmDedupe = require ( 'classnames/dedupe' ) ;
8
- var npmPackage = require ( './node_modules/ classnames/package.json' ) ;
6
+ var npm = require ( 'classnames-npm ' ) ;
7
+ var npmDedupe = require ( 'classnames-npm /dedupe' ) ;
8
+ var npmPackage = require ( 'classnames-npm /package.json' ) ;
9
9
10
10
function log ( message ) {
11
11
console . log ( message ) ;
@@ -16,7 +16,7 @@ function log (message) {
16
16
17
17
if ( localPackage . version !== npmPackage . version ) {
18
18
log ( 'Your local version (' + localPackage . version + ') does not match the installed version (' + npmPackage . version + ')\n\n' +
19
- 'Please run `npm update` in ./benchmarks to ensure you are benchmarking\n' +
19
+ 'Please run `npm update classnames-npm ` in ./benchmarks to ensure you are benchmarking\n' +
20
20
'the latest version of this package.\n' ) ;
21
21
return ;
22
22
}
You can’t perform that action at this time.
0 commit comments