Last active
October 22, 2015 16:19
-
-
Save akeelnazir/d80f66c2914d41ce6809 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pre = [0.204, | |
0.164, | |
0.020, | |
0.093, | |
0.117, | |
0.124, | |
0.076, | |
0.106, | |
0.117, | |
0.097, | |
0.068, | |
0.076, | |
0.091, | |
0.097, | |
0.088, | |
0.092, | |
0.083, | |
0.104, | |
0.119, | |
0.066, | |
0.389, | |
0.066, | |
0.073, | |
0.103, | |
0.276, | |
0.125, | |
0.065, | |
0.221, | |
0.083, | |
0.108, | |
0.087, | |
0.118, | |
0.080]; | |
var post=[0.252, | |
0.156, | |
0.247, | |
0.114, | |
0.334, | |
0.094, | |
0.111, | |
0.089, | |
0.451, | |
0.131, | |
0.089, | |
0.108, | |
0.075, | |
0.068, | |
0.066, | |
0.064, | |
0.065, | |
0.067, | |
0.077, | |
0.064, | |
0.068, | |
0.066, | |
0.070, | |
0.076, | |
0.068, | |
0.081, | |
0.068, | |
0.072, | |
0.067, | |
0.084, | |
0.069, | |
0.071, | |
0.069]; | |
var post2 = [ 0.376, | |
0.163, | |
0.118, | |
0.105, | |
0.000, | |
0.060, | |
0.056, | |
0.062, | |
0.097, | |
0.184, | |
0.100, | |
0.061, | |
0.059, | |
0.135, | |
0.054, | |
0.054, | |
0.050, | |
0.059, | |
0.143, | |
0.062, | |
0.053, | |
0.076, | |
0.147, | |
0.094, | |
0.042, | |
0.190, | |
0.058, | |
0.066, | |
0.055, | |
0.065, | |
0.035, | |
0.087, | |
0.096]; | |
var productItemRenderPre = [1.040, | |
1.217, | |
1.214, | |
1.020, | |
0.801, | |
1.517, | |
0.582, | |
1.263, | |
0.899, | |
0.683, | |
0.675, | |
0.542, | |
0.603, | |
1.155, | |
0.931, | |
0.729, | |
0.701, | |
0.672, | |
0.562, | |
0.567, | |
0.608, | |
1.597, | |
0.586, | |
0.840, | |
1.136, | |
1.039, | |
0.995, | |
0.721, | |
0.835, | |
0.540, | |
0.711, | |
1.266, | |
0.793]; | |
var productItemRenderPost = [1.095, | |
0.635, | |
0.490, | |
0.147, | |
0.427, | |
0.529, | |
0.747, | |
2.017, | |
0.553, | |
1.397, | |
0.656, | |
0.915, | |
0.745, | |
0.758, | |
0.699, | |
0.754, | |
0.825, | |
0.507, | |
0.529, | |
0.455, | |
1.356, | |
0.703, | |
0.544, | |
0.476, | |
0.197, | |
0.618, | |
0.450, | |
0.741, | |
0.719, | |
0.698, | |
0.640, | |
0.580, | |
1.286]; | |
var productItemRenderPost2 = [0.746, | |
0.534, | |
0.565, | |
0.419, | |
0.292, | |
0.319, | |
0.268, | |
0.455, | |
0.509, | |
0.426, | |
0.515, | |
0.482, | |
1.790, | |
0.279, | |
0.257, | |
0.298, | |
0.433, | |
0.426, | |
0.557, | |
0.371, | |
0.271, | |
0.284, | |
0.332, | |
0.316, | |
0.316, | |
1.744, | |
0.466, | |
0.684, | |
0.577, | |
0.594, | |
0.459, | |
0.106, | |
0.551]; | |
var productItemRenderPost3 = [ 0.535, | |
0.537, | |
0.398, | |
0.439, | |
0.455, | |
0.636, | |
0.433, | |
0.409, | |
0.401, | |
0.630, | |
0.685, | |
1.110, | |
1.232, | |
0.889, | |
2.237, | |
0.976, | |
0.491, | |
0.408, | |
0.725, | |
0.589, | |
0.409, | |
0.430, | |
0.764, | |
0.424, | |
0.645, | |
1.421, | |
0.590, | |
0.656, | |
0.420, | |
0.632, | |
0.406, | |
0.779, | |
0.269]; | |
var productItemRenderPost4 = [ 0.619, | |
0.532, | |
0.189, | |
1.324, | |
0.314, | |
0.299, | |
0.420, | |
0.450, | |
0.411, | |
2.347, | |
0.998, | |
0.339, | |
0.377, | |
0.061, | |
0.180, | |
0.423, | |
0.265, | |
0.316, | |
0.322, | |
0.319, | |
0.330, | |
0.001, | |
0.293, | |
0.402, | |
0.298, | |
0.416, | |
0.746, | |
0.265, | |
0.247, | |
0.320, | |
0.316, | |
0.496, | |
0.546]; | |
var productItemRenderPost5 = [1.059, | |
0.487, | |
0.459, | |
0.985, | |
0.889, | |
1.080, | |
0.583, | |
0.428, | |
0.658, | |
0.739, | |
0.499, | |
0.978, | |
0.547, | |
0.508, | |
0.405, | |
0.444, | |
0.452, | |
0.440, | |
0.554, | |
1.477, | |
0.397, | |
0.355, | |
0.413, | |
0.715, | |
0.639, | |
0.924, | |
0.508, | |
0.422, | |
0.611, | |
0.689, | |
0.521, | |
0.608, | |
0.359 | |
]; | |
var productItemRenderPost6 = [1.060, | |
0.496, | |
0.831, | |
0.417, | |
0.397, | |
0.437, | |
0.535, | |
0.673, | |
0.497, | |
0.827, | |
1.235, | |
0.506, | |
0.473, | |
0.568, | |
0.783, | |
0.406, | |
0.618, | |
0.648, | |
0.388, | |
0.486, | |
0.400, | |
0.365, | |
0.428, | |
0.831, | |
0.501, | |
0.274, | |
0.332, | |
0.431, | |
0.615, | |
0.706, | |
0.434, | |
0.534] | |
var productItemRenderPost7 = [0.848, | |
0.911, | |
0.492, | |
0.500, | |
0.405, | |
0.551, | |
0.368, | |
0.979, | |
0.870, | |
0.549, | |
0.621, | |
0.612, | |
0.383, | |
0.385, | |
0.446, | |
0.524, | |
0.419, | |
0.543, | |
0.339, | |
0.374, | |
0.282, | |
0.892, | |
0.393, | |
0.374, | |
0.571, | |
1.050, | |
0.396, | |
0.655, | |
0.323, | |
0.666, | |
0.740, | |
0.574, | |
0.364]; | |
function getAverage(array) { | |
var sum = 0; | |
for( var i = 0; i < array.length; i++ ){ | |
sum += array[i]; //don't forget to add the base | |
} | |
return sum/array.length; | |
} | |
$('body') | |
.append('<p>product-item.render() Pre:: ' + getAverage(productItemRenderPre) + 'ms</p>') | |
.append('<p>product-item.render() Post:: ' + getAverage(productItemRenderPost) + 'ms</p>') | |
.append('<p>product-item.render() Post:: ' + getAverage(productItemRenderPost2) + 'ms</p>') | |
.append('<p>product-item.render() Post:: ' + getAverage(productItemRenderPost3) + 'ms</p>') | |
.append('<p>product-item.render() Post:: ' + getAverage(productItemRenderPost4) + 'ms</p>') | |
.append('<p>product-item.render() Post:: ' + getAverage(productItemRenderPost5) + 'ms</p>') | |
.append('<p>product-item.render() Post:: ' + getAverage(productItemRenderPost6) + 'ms</p>') | |
.append('<p>product-item.render() Post:: ' + getAverage(productItemRenderPost7) + 'ms</p>') | |
; | |
console.log (getAverage(pre)); | |
console.log (getAverage(post)); | |
console.log (getAverage(post2)); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment