File tree Expand file tree Collapse file tree 3 files changed +14
-16
lines changed Expand file tree Collapse file tree 3 files changed +14
-16
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+
3
+ TIMESTAMP=" $( date ' +%Y-%m-%dT%H:%M:%S' ) "
4
+
5
+ logfile=" $( printf ' %s-' " $@ " ) ${TIMESTAMP} -analyze-v8.log"
6
+
7
+ node --prof --log-all --logfile=" $logfile " " $@ "
Original file line number Diff line number Diff line change 3
3
"scripts" : {
4
4
"build-cmd" : " babel --delete-dir-on-start" ,
5
5
"build:profile" : " yarn build-cmd --env-name profile --out-dir dist/profile ../src" ,
6
+ "analyze" : " sh analyze.sh" ,
6
7
"profile" : " sh profile.sh"
7
8
},
8
9
"dependencies" : {
Original file line number Diff line number Diff line change 1
- console . time ( 'prepare' ) ;
2
- require ( 'regenerator-runtime/runtime' ) ;
3
- const ArgumentParser = require ( 'argparse' ) . ArgumentParser ;
4
- const empty = require ( '..' ) . empty ;
1
+ import 'regenerator-runtime/runtime.js' ;
2
+ import { ArgumentParser } from 'argparse' ;
3
+ import { FAST_COUNTER as COUNTER } from '../test/src/_fixtures.js' ;
4
+ import { empty } from './dist/profile/index.js' ;
5
5
6
- const COUNTER = {
7
- plus ( a , b ) {
8
- return a + b ;
9
- } ,
10
- measure ( _x ) {
11
- return 1 ;
12
- } ,
13
- zero ( ) {
14
- return 0 ;
15
- } ,
16
- } ;
6
+ console . time ( 'prepare' ) ;
17
7
18
8
const parser = new ArgumentParser ( ) ;
19
9
parser . add_argument ( 'M' , { default : 1000 , nargs : '?' } ) ;
@@ -30,7 +20,7 @@ console.timeEnd('prepare');
30
20
console . time ( 'push' ) ;
31
21
for ( let k = 0 ; k < N ; ++ k ) {
32
22
let x = t ;
33
- for ( let i = 0 ; i < M ; ++ i ) x = x . push ( ) ;
23
+ for ( let i = 0 ; i < M ; ++ i ) x = x . push ( i ) ;
34
24
}
35
25
36
26
console . timeEnd ( 'push' ) ;
You can’t perform that action at this time.
0 commit comments