File tree Expand file tree Collapse file tree 7 files changed +84
-28
lines changed
test/jasmine/performance_tests Expand file tree Collapse file tree 7 files changed +84
-28
lines changed Original file line number Diff line number Diff line change @@ -45,12 +45,20 @@ tests.forEach(function(spec, index) {
45
45
}
46
46
} ;
47
47
48
- var startTime ;
48
+ var startTime , endTime ;
49
49
50
50
beforeEach ( function ( done ) {
51
- startTime = Date . now ( ) ;
51
+ startTime = performance . now ( ) ;
52
+
53
+ // Wait for actual rendering to complete
54
+ requestAnimationFrame ( function ( ) {
55
+ requestAnimationFrame ( function ( ) {
56
+ endTime = performance . now ( ) ;
57
+ done ( ) ;
58
+ } ) ;
59
+ } ) ;
52
60
53
- Plotly . newPlot ( gd , mock ) . then ( done ) ;
61
+ Plotly . newPlot ( gd , mock ) ;
54
62
} ) ;
55
63
56
64
afterEach ( function ( done ) {
@@ -62,7 +70,7 @@ tests.forEach(function(spec, index) {
62
70
63
71
samples . forEach ( function ( t ) {
64
72
it ( 'should graph bar traces | turn: ' + t , function ( ) {
65
- var delta = Date . now ( ) - startTime ;
73
+ var delta = endTime - startTime ;
66
74
67
75
if ( t === 0 ) {
68
76
// console.log('________________________________');
Original file line number Diff line number Diff line change @@ -46,12 +46,20 @@ tests.forEach(function(spec, index) {
46
46
}
47
47
} ;
48
48
49
- var startTime ;
49
+ var startTime , endTime ;
50
50
51
51
beforeEach ( function ( done ) {
52
- startTime = Date . now ( ) ;
52
+ startTime = performance . now ( ) ;
53
+
54
+ // Wait for actual rendering to complete
55
+ requestAnimationFrame ( function ( ) {
56
+ requestAnimationFrame ( function ( ) {
57
+ endTime = performance . now ( ) ;
58
+ done ( ) ;
59
+ } ) ;
60
+ } ) ;
53
61
54
- Plotly . newPlot ( gd , mock ) . then ( done ) ;
62
+ Plotly . newPlot ( gd , mock ) ;
55
63
} ) ;
56
64
57
65
afterEach ( function ( done ) {
@@ -63,7 +71,7 @@ tests.forEach(function(spec, index) {
63
71
64
72
samples . forEach ( function ( t ) {
65
73
it ( 'should graph box traces | turn: ' + t , function ( ) {
66
- var delta = Date . now ( ) - startTime ;
74
+ var delta = endTime - startTime ;
67
75
68
76
if ( t === 0 ) {
69
77
// console.log('________________________________');
Original file line number Diff line number Diff line change @@ -56,12 +56,20 @@ tests.forEach(function(spec, index) {
56
56
}
57
57
} ;
58
58
59
- var startTime ;
59
+ var startTime , endTime ;
60
60
61
61
beforeEach ( function ( done ) {
62
- startTime = Date . now ( ) ;
62
+ startTime = performance . now ( ) ;
63
+
64
+ // Wait for actual rendering to complete
65
+ requestAnimationFrame ( function ( ) {
66
+ requestAnimationFrame ( function ( ) {
67
+ endTime = performance . now ( ) ;
68
+ done ( ) ;
69
+ } ) ;
70
+ } ) ;
63
71
64
- Plotly . newPlot ( gd , mock ) . then ( done ) ;
72
+ Plotly . newPlot ( gd , mock ) ;
65
73
} ) ;
66
74
67
75
afterEach ( function ( done ) {
@@ -73,7 +81,7 @@ tests.forEach(function(spec, index) {
73
81
74
82
samples . forEach ( function ( t ) {
75
83
it ( 'should graph contour traces | turn: ' + t , function ( ) {
76
- var delta = Date . now ( ) - startTime ;
84
+ var delta = endTime - startTime ;
77
85
78
86
if ( t === 0 ) {
79
87
// console.log('________________________________');
Original file line number Diff line number Diff line change @@ -56,12 +56,20 @@ tests.forEach(function(spec, index) {
56
56
}
57
57
} ;
58
58
59
- var startTime ;
59
+ var startTime , endTime ;
60
60
61
61
beforeEach ( function ( done ) {
62
- startTime = Date . now ( ) ;
62
+ startTime = performance . now ( ) ;
63
+
64
+ // Wait for actual rendering to complete
65
+ requestAnimationFrame ( function ( ) {
66
+ requestAnimationFrame ( function ( ) {
67
+ endTime = performance . now ( ) ;
68
+ done ( ) ;
69
+ } ) ;
70
+ } ) ;
63
71
64
- Plotly . newPlot ( gd , mock ) . then ( done ) ;
72
+ Plotly . newPlot ( gd , mock ) ;
65
73
} ) ;
66
74
67
75
afterEach ( function ( done ) {
@@ -73,7 +81,7 @@ tests.forEach(function(spec, index) {
73
81
74
82
samples . forEach ( function ( t ) {
75
83
it ( 'should graph heatmap traces | turn: ' + t , function ( ) {
76
- var delta = Date . now ( ) - startTime ;
84
+ var delta = endTime - startTime ;
77
85
78
86
if ( t === 0 ) {
79
87
// console.log('________________________________');
Original file line number Diff line number Diff line change @@ -45,12 +45,20 @@ tests.forEach(function(spec, index) {
45
45
}
46
46
} ;
47
47
48
- var startTime ;
48
+ var startTime , endTime ;
49
49
50
50
beforeEach ( function ( done ) {
51
- startTime = Date . now ( ) ;
51
+ startTime = performance . now ( ) ;
52
+
53
+ // Wait for actual rendering to complete
54
+ requestAnimationFrame ( function ( ) {
55
+ requestAnimationFrame ( function ( ) {
56
+ endTime = performance . now ( ) ;
57
+ done ( ) ;
58
+ } ) ;
59
+ } ) ;
52
60
53
- Plotly . newPlot ( gd , mock ) . then ( done ) ;
61
+ Plotly . newPlot ( gd , mock ) ;
54
62
} ) ;
55
63
56
64
afterEach ( function ( done ) {
@@ -62,7 +70,7 @@ tests.forEach(function(spec, index) {
62
70
63
71
samples . forEach ( function ( t ) {
64
72
it ( 'should graph histogram traces | turn: ' + t , function ( ) {
65
- var delta = Date . now ( ) - startTime ;
73
+ var delta = endTime - startTime ;
66
74
67
75
if ( t === 0 ) {
68
76
// console.log('________________________________');
Original file line number Diff line number Diff line change @@ -63,12 +63,20 @@ tests.forEach(function(spec, index) {
63
63
}
64
64
} ;
65
65
66
- var startTime ;
66
+ var startTime , endTime ;
67
67
68
68
beforeEach ( function ( done ) {
69
- startTime = Date . now ( ) ;
69
+ startTime = performance . now ( ) ;
70
+
71
+ // Wait for actual rendering to complete
72
+ requestAnimationFrame ( function ( ) {
73
+ requestAnimationFrame ( function ( ) {
74
+ endTime = performance . now ( ) ;
75
+ done ( ) ;
76
+ } ) ;
77
+ } ) ;
70
78
71
- Plotly . newPlot ( gd , mock ) . then ( done ) ;
79
+ Plotly . newPlot ( gd , mock ) ;
72
80
} ) ;
73
81
74
82
afterEach ( function ( done ) {
@@ -80,7 +88,7 @@ tests.forEach(function(spec, index) {
80
88
81
89
samples . forEach ( function ( t ) {
82
90
it ( 'should graph image traces | turn: ' + t , function ( ) {
83
- var delta = Date . now ( ) - startTime ;
91
+ var delta = endTime - startTime ;
84
92
85
93
if ( t === 0 ) {
86
94
// console.log('________________________________');
Original file line number Diff line number Diff line change @@ -43,12 +43,20 @@ tests.forEach(function(spec, index) {
43
43
}
44
44
} ;
45
45
46
- var startTime ;
46
+ var startTime , endTime ;
47
47
48
48
beforeEach ( function ( done ) {
49
- startTime = Date . now ( ) ;
49
+ startTime = performance . now ( ) ;
50
+
51
+ // Wait for actual rendering to complete
52
+ requestAnimationFrame ( function ( ) {
53
+ requestAnimationFrame ( function ( ) {
54
+ endTime = performance . now ( ) ;
55
+ done ( ) ;
56
+ } ) ;
57
+ } ) ;
50
58
51
- Plotly . newPlot ( gd , mock ) . then ( done ) ;
59
+ Plotly . newPlot ( gd , mock ) ;
52
60
} ) ;
53
61
54
62
afterEach ( function ( done ) {
@@ -60,7 +68,7 @@ tests.forEach(function(spec, index) {
60
68
61
69
samples . forEach ( function ( t ) {
62
70
it ( 'should graph scatter traces | turn: ' + t , function ( ) {
63
- var delta = Date . now ( ) - startTime ;
71
+ var delta = endTime - startTime ;
64
72
65
73
if ( t === 0 ) {
66
74
// console.log('________________________________');
You can’t perform that action at this time.
0 commit comments