Title: [282465] trunk/Tools
Revision
282465
Author
[email protected]
Date
2021-09-15 12:52:18 -0700 (Wed, 15 Sep 2021)

Log Message

Cache resource paths in run-jsc-stress-tests for speedup
https://bugs.webkit.org/show_bug.cgi?id=230263

Patch by Geza Lore <[email protected]> on 2021-09-15
Reviewed by Adrian Perez de Castro.

A large portion of the serial startup time of run-jsc-stress-tests is
just re-computing file system paths of bundle resources over and over
again. Cache results for a 40% speedup of the test enumeration phase.

* Scripts/run-jsc-stress-tests:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (282464 => 282465)


--- trunk/Tools/ChangeLog	2021-09-15 18:37:12 UTC (rev 282464)
+++ trunk/Tools/ChangeLog	2021-09-15 19:52:18 UTC (rev 282465)
@@ -1,3 +1,16 @@
+2021-09-15  Geza Lore  <[email protected]>
+
+        Cache resource paths in run-jsc-stress-tests for speedup
+        https://bugs.webkit.org/show_bug.cgi?id=230263
+
+        Reviewed by Adrian Perez de Castro.
+
+        A large portion of the serial startup time of run-jsc-stress-tests is
+        just re-computing file system paths of bundle resources over and over
+        again. Cache results for a 40% speedup of the test enumeration phase.
+
+        * Scripts/run-jsc-stress-tests:
+
 2021-09-14  Don Olmstead  <[email protected]>
 
         Rename RESOURCE_LOAD_STATISTICS to INTELLIGENT_TRACKING_PREVENTION

Modified: trunk/Tools/Scripts/run-jsc-stress-tests (282464 => 282465)


--- trunk/Tools/Scripts/run-jsc-stress-tests	2021-09-15 18:37:12 UTC (rev 282464)
+++ trunk/Tools/Scripts/run-jsc-stress-tests	2021-09-15 19:52:18 UTC (rev 282465)
@@ -587,15 +587,21 @@
     end
 end
 
-def pathToBundleResourceFromBenchmarkDirectory(resourcePath)
-    dir = Pathname.new(".")
-    $benchmarkDirectory.each_filename {
+
+# Frequently repeated path computations. Cache results for speed.
+$bundleResourcePathCache = Hash.new do |h, key|
+    resourcePath, benchmarkDirectory, dir = key
+    benchmarkDirectory.each_filename {
         | pathComponent |
-        dir += ".."
+        dir = dir.parent
     }
-    dir + resourcePath
+    h[key] = dir + resourcePath
 end
 
+def pathToBundleResourceFromBenchmarkDirectory(resourcePath)
+    $bundleResourcePathCache[[resourcePath, $benchmarkDirectory, Pathname.new(".")]]
+end
+
 def pathToVM
     pathToBundleResourceFromBenchmarkDirectory($jscPath)
 end
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to