aboutsummaryrefslogtreecommitdiff
path: root/test/examples/array-micro.js
diff options
context:
space:
mode:
authorhannesw <none@none>2013-10-17 17:33:16 +0200
committerhannesw <none@none>2013-10-17 17:33:16 +0200
commitcb755b54b3a57c1aacecd7e112510611a4053aa2 (patch)
treed9b8da37c319fe406f1907a4c42ad47554b74a77 /test/examples/array-micro.js
parent13df33a2ab6fc2369cb8fd535bf644939d30319f (diff)
8026701: Array.prototype.splice is slow on dense arrays
Reviewed-by: lagergren, sundar, jlaskey
Diffstat (limited to 'test/examples/array-micro.js')
-rw-r--r--test/examples/array-micro.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/examples/array-micro.js b/test/examples/array-micro.js
index 075e78d8..9bb898f6 100644
--- a/test/examples/array-micro.js
+++ b/test/examples/array-micro.js
@@ -90,6 +90,24 @@ bench("set", function() {
array[6] = 6;
});
+bench("push", function() {
+ var arr = [1, 2, 3];
+ arr.push(4);
+ arr.push(5);
+ arr.push(6);
+});
+
+bench("pop", function() {
+ var arr = [1, 2, 3];
+ arr.pop();
+ arr.pop();
+ arr.pop();
+});
+
+bench("splice", function() {
+ [1, 2, 3].splice(0, 2, 5, 6, 7);
+});
+
var all = function(e) { return true; };
var none = function(e) { return false; };