EventTargetFactory.in is not sorted
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Oct 2011 23:43:33 +0000 (23:43 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Oct 2011 23:43:33 +0000 (23:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=70855

Reviewed by Eric Seidel.

PerformanceTests:

Add a microbenchmark for wrapping event target.

* Bindings: Added.
* Bindings/event-target-wrapper.html: Added.
* Parser/resources/runner.js:
(runLoop):
    - Let the user of the harness get a callback when the test is done.

Source/WebCore:

This patch sorts the file.  I was not able to measure a performance
difference using the microbenchmark included with this patch.

* dom/EventTargetFactory.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@98412 268f45cc-cd09-0410-ab3c-d52691b4dbfc

PerformanceTests/Bindings/event-target-wrapper.html [new file with mode: 0644]
PerformanceTests/ChangeLog
PerformanceTests/Parser/resources/runner.js
Source/WebCore/ChangeLog
Source/WebCore/dom/EventTargetFactory.in

diff --git a/PerformanceTests/Bindings/event-target-wrapper.html b/PerformanceTests/Bindings/event-target-wrapper.html
new file mode 100644 (file)
index 0000000..ebc6b77
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<body>
+<pre id="log"></pre>
+<script src="../Parser/resources/runner.js"></script>
+<a href="#">Click here to start</a>
+<script>
+var link = document.getElementsByTagName('a')[0];
+var evt = null;
+var kIteratonsPerTest = 1000000;
+
+link.addEventListener('click', function(event) {
+    link.textContent = '';
+    window.evt = event;
+    event.preventDefault();
+
+    start(20, function() {
+        var e = window.evt;
+        for (var x = 0; x < kIteratonsPerTest; x++) {
+            e.target;
+        }
+    }, 10, function() {
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    });
+
+    return false;
+}, false);
+
+if (window.layoutTestController) {
+    layoutTestController.waitUntilDone();
+    layoutTestController.dumpAsText();
+}
+
+if (window.eventSender) {
+    eventSender.mouseMoveTo(link.offsetLeft + 5, link.offsetTop + 5);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+}
+</script>
+</body>
index 9c51196..3e5bb46 100644 (file)
@@ -1,3 +1,18 @@
+2011-10-25  Adam Barth  <abarth@webkit.org>
+
+        EventTargetFactory.in is not sorted
+        https://bugs.webkit.org/show_bug.cgi?id=70855
+
+        Reviewed by Eric Seidel.
+
+        Add a microbenchmark for wrapping event target.
+
+        * Bindings: Added.
+        * Bindings/event-target-wrapper.html: Added.
+        * Parser/resources/runner.js:
+        (runLoop):
+            - Let the user of the harness get a callback when the test is done.
+
 2011-10-04  Eric Seidel  <eric@webkit.org>
 
         Update html5-full-render.html to load the HTML5 spec incrementally, closer to how the browser would
index f849054..68b6e3c 100644 (file)
@@ -73,6 +73,7 @@ function runLoop()
         window.setTimeout(run, 0);
     } else {
         logStatistics(times);
+        window.doneFunction();
     }
 }
 
@@ -91,10 +92,11 @@ function run() {
     runLoop()
 }
 
-function start(runCount, runFunction, loopsPerRun) {
+function start(runCount, runFunction, loopsPerRun, doneFunction) {
     window.runCount = runCount;
     window.runFunction = runFunction;
     window.loopsPerRun = loopsPerRun || 10;
+    window.doneFunction = doneFunction || function() {};
 
     log("Running " + runCount + " times");
     runLoop();
index 0760413..e56084b 100644 (file)
@@ -1,5 +1,17 @@
 2011-10-25  Adam Barth  <abarth@webkit.org>
 
+        EventTargetFactory.in is not sorted
+        https://bugs.webkit.org/show_bug.cgi?id=70855
+
+        Reviewed by Eric Seidel.
+
+        This patch sorts the file.  I was not able to measure a performance
+        difference using the microbenchmark included with this patch.
+
+        * dom/EventTargetFactory.in:
+
+2011-10-25  Adam Barth  <abarth@webkit.org>
+
         Attempt to fix the Windows build.  Windows mashes all these files into
         one, which doesn't respect the compilation unit rules of C++.
 
index d5e0e78..6bdb2e2 100644 (file)
@@ -1,27 +1,27 @@
 namespace="EventTarget"
 
-EventSource
-MessagePort
-Node
-DOMWindow
-XMLHttpRequest
-XMLHttpRequestUpload
-DOMApplicationCache
-SVGElementInstance conditional=SVG
-Worker conditional=WORKERS
-DedicatedWorkerContext conditional=WORKERS
-SharedWorker conditional=SHARED_WORKERS
-SharedWorkerContext conditional=SHARED_WORKERS
 AudioContext conditional=WEB_AUDIO
-JavaScriptAudioNode conditional=WEB_AUDIO
-WebSocket conditional=WEB_SOCKETS
-Notification conditional=NOTIFICATIONS
+DedicatedWorkerContext conditional=WORKERS
+DOMApplicationCache
+DOMWindow
+EventSource
 FileReader conditional=BLOB
 FileWriter conditional=FILE_SYSTEM
 IDBDatabase conditional=INDEXED_DATABASE
 IDBRequest conditional=INDEXED_DATABASE
 IDBTransaction conditional=INDEXED_DATABASE
 IDBVersionChangeRequest conditional=INDEXED_DATABASE
-MediaStream conditional=MEDIA_STREAM
+JavaScriptAudioNode conditional=WEB_AUDIO
 LocalMediaStream conditional=MEDIA_STREAM
+MediaStream conditional=MEDIA_STREAM
+MessagePort
+Node
+Notification conditional=NOTIFICATIONS
 PeerConnection conditional=MEDIA_STREAM
+SharedWorker conditional=SHARED_WORKERS
+SharedWorkerContext conditional=SHARED_WORKERS
+SVGElementInstance conditional=SVG
+WebSocket conditional=WEB_SOCKETS
+Worker conditional=WORKERS
+XMLHttpRequest
+XMLHttpRequestUpload