Title: [217107] trunk/PerformanceTests
Revision
217107
Author
rn...@webkit.org
Date
2017-05-19 02:19:01 -0700 (Fri, 19 May 2017)

Log Message

Speedometer 2.0: Vanilla JS test doesn't mark all todo items as completed
https://bugs.webkit.org/show_bug.cgi?id=172348

Reviewed by Antti Koivisto.

The bug was caused by the in-memory store class using the milisecond precision timestamp as an ID.
Because we inserts 50 items all at once, this can result in multiple data items sharing a single ID.

Fixed the bug by using a mononotically increasing ID instead.

* Speedometer/resources/todomvc/vanilla-examples/vanillajs/js/store.js:
(Store.prototype.save):

Modified Paths

Diff

Modified: trunk/PerformanceTests/ChangeLog (217106 => 217107)


--- trunk/PerformanceTests/ChangeLog	2017-05-19 09:11:47 UTC (rev 217106)
+++ trunk/PerformanceTests/ChangeLog	2017-05-19 09:19:01 UTC (rev 217107)
@@ -1,3 +1,18 @@
+2017-05-19  Ryosuke Niwa  <rn...@webkit.org>
+
+        Speedometer 2.0: Vanilla JS test doesn't mark all todo items as completed
+        https://bugs.webkit.org/show_bug.cgi?id=172348
+
+        Reviewed by Antti Koivisto.
+
+        The bug was caused by the in-memory store class using the milisecond precision timestamp as an ID.
+        Because we inserts 50 items all at once, this can result in multiple data items sharing a single ID.
+
+        Fixed the bug by using a mononotically increasing ID instead.
+
+        * Speedometer/resources/todomvc/vanilla-examples/vanillajs/js/store.js:
+        (Store.prototype.save):
+
 2017-05-18  Ryosuke Niwa  <rn...@webkit.org>
 
         REGRESSION (r216694 - 216712): Performance test Speedometer/Full.html is failing

Modified: trunk/PerformanceTests/Speedometer/resources/todomvc/vanilla-examples/vanillajs/js/store.js (217106 => 217107)


--- trunk/PerformanceTests/Speedometer/resources/todomvc/vanilla-examples/vanillajs/js/store.js	2017-05-19 09:11:47 UTC (rev 217106)
+++ trunk/PerformanceTests/Speedometer/resources/todomvc/vanilla-examples/vanillajs/js/store.js	2017-05-19 09:19:01 UTC (rev 217107)
@@ -3,6 +3,8 @@
     'use strict';
 
     var MemoryStorage = {};
+    var id = 1;
+
     /**
      * Creates a new client side storage object and will create an empty
      * collection if no collection already exists.
@@ -96,7 +98,7 @@
             callback.call(this, todos);
         } else {
             // Generate an ID
-            updateData.id = new Date().getTime();
+            updateData.id = id++;
 
             todos.push(updateData);
             MemoryStorage[this._dbName] = JSON.stringify(data);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to