File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -26,24 +26,25 @@ console.log('Running benchmark on /dist/analyzer.js:')
2626
2727const suite = [ ]
2828
29- files . forEach ( ( [ filename , name , expectedDuration ] ) => {
29+ files . forEach ( ( [ filename , name ] ) => {
3030 const css = fs . readFileSync ( `./src/__fixtures__/${ filename } .css` , 'utf-8' )
3131 const fileSize = byteSize ( css . length )
3232 suite . push ( [
3333 `${ name . padEnd ( maxLen + 2 ) } (${ fileSize . padStart ( 7 ) } )` ,
3434 ( ) => analyzeCss ( css ) ,
35- `${ ( process . memoryUsage ( ) . heapUsed / 1024 / 1024 ) . toFixed ( 3 ) } MB`
3635 ] )
3736} )
3837
38+ let startMemory = process . memoryUsage ( ) . heapUsed
39+
3940suite . forEach ( ( [ name , fn , memory ] ) => {
4041 const start = new Date ( )
4142 fn ( )
4243 const duration = ( new Date ( ) - start )
4344 console . log (
4445 name ,
4546 `${ duration } ms` . padStart ( 6 , ' ' ) ,
46- memory ,
4747 )
4848} )
4949
50+ console . log ( ( ( process . memoryUsage ( ) . heapUsed - startMemory ) / 1024 / 1024 ) . toFixed ( 2 ) + 'MB' )
You can’t perform that action at this time.
0 commit comments