Index: third_party/WebKit/PerformanceTests/Bindings/sequence-conversion-custom-iterator.html |
diff --git a/third_party/WebKit/PerformanceTests/Bindings/sequence-conversion-custom-iterator.html b/third_party/WebKit/PerformanceTests/Bindings/sequence-conversion-custom-iterator.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..363ad3f9b35d4bc66c2ec80e75e291c853a2aa1c |
--- /dev/null |
+++ b/third_party/WebKit/PerformanceTests/Bindings/sequence-conversion-custom-iterator.html |
@@ -0,0 +1,30 @@ |
+<!DOCTYPE html> |
+<html> |
+<body> |
+<script src="../resources/runner.js"></script> |
+<script> |
+let dataArray = []; |
+for (let i = 0; i < 100000; i++) |
+ dataArray.push('abcdefg foo bar baz'); |
+ |
+let iterableData = { |
+ [Symbol.iterator]() { |
+ var count = 0; |
+ return { |
+ next() { |
+ if (count >= dataArray.length) |
+ return {done: true}; |
+ return {done: false, value: dataArray[count++]}; |
+ } |
+ } |
+ } |
+}; |
+ |
+PerfTestRunner.measureRunsPerSecond({ |
+ description: "This benchmark measures the overhead of converting JavaScript objects into WebIDL sequences (slow path using the @@iteratorprotocol)", |
+ run: function() { |
+ new Blob(iterableData); |
+ }}); |
+</script> |
+</body> |
+</html> |