This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ platform=` uname`
4
+ if [[ " $platform " == ' Linux' ]]; then
5
+ ` google-chrome --js-flags=" --expose-gc" `
6
+ elif [[ " $platform " == ' Darwin' ]]; then
7
+ ` /Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --js-flags=" --expose-gc" `
8
+ fi
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ window.addEventListener('DOMContentLoaded', function() {
35
35
btn . innerText = "Loop" ;
36
36
var running = false ;
37
37
btn . addEventListener ( 'click' , loopBenchmark ) ;
38
-
38
+
39
39
container . appendChild ( btn ) ;
40
40
41
41
function loopBenchmark ( ) {
@@ -50,10 +50,10 @@ window.addEventListener('DOMContentLoaded', function() {
50
50
if ( running ) {
51
51
window . requestAnimationFrame ( function ( ) {
52
52
if ( running ) runBenchmarkSteps ( loopB ) ;
53
- } ) ;
53
+ } ) ;
54
54
}
55
55
} ;
56
- loopB ( ) ;
56
+ loopB ( ) ;
57
57
} ) ;
58
58
}
59
59
}
@@ -68,7 +68,7 @@ window.addEventListener('DOMContentLoaded', function() {
68
68
runBenchmarkSteps ( function ( ) {
69
69
onceBtn . innerText = "Once" ;
70
70
} ) ;
71
- } ) ;
71
+ } ) ;
72
72
} ) ;
73
73
} ) ;
74
74
container . appendChild ( onceBtn ) ;
@@ -99,6 +99,9 @@ window.addEventListener('DOMContentLoaded', function() {
99
99
// Run all the steps;
100
100
var times = { } ;
101
101
window . benchmarkSteps . forEach ( function ( bs ) {
102
+ if ( typeof window . gc === 'function' ) {
103
+ window . gc ( ) ;
104
+ }
102
105
var startTime = numMilliseconds ( ) ;
103
106
bs . fn ( ) ;
104
107
times [ bs . name ] = numMilliseconds ( ) - startTime ;
@@ -109,7 +112,7 @@ window.addEventListener('DOMContentLoaded', function() {
109
112
}
110
113
111
114
var timesPerAction = { } ;
112
-
115
+
113
116
var NUM_SAMPLES = 10 ;
114
117
function calcStats ( times ) {
115
118
var iH = '' ;
You can’t perform that action at this time.
0 commit comments