⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 282465 in webkit


Ignore:
Timestamp:
Sep 15, 2021, 12:52:18 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Geza Lore <​gezalore@gmail.com> 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:
Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r282431 r282465  
     12021-09-15  Geza Lore  <gezalore@gmail.com>
     2
     3        Cache resource paths in run-jsc-stress-tests for speedup
     4        https://bugs.webkit.org/show_bug.cgi?id=230263
     5
     6        Reviewed by Adrian Perez de Castro.
     7
     8        A large portion of the serial startup time of run-jsc-stress-tests is
     9        just re-computing file system paths of bundle resources over and over
     10        again. Cache results for a 40% speedup of the test enumeration phase.
     11
     12        * Scripts/run-jsc-stress-tests:
     13
    1142021-09-14  Don Olmstead  <don.olmstead@sony.com>
    215
  • trunk/Tools/Scripts/run-jsc-stress-tests

    r281438 r282465  
    588588end
    589589
     590
     591# Frequently repeated path computations. Cache results for speed.
     592$bundleResourcePathCache = Hash.new do |h, key|
     593    resourcePath, benchmarkDirectory, dir = key
     594    benchmarkDirectory.each_filename {
     595        | pathComponent |
     596        dir = dir.parent
     597    }
     598    h[key] = dir + resourcePath
     599end
     600
    590601def pathToBundleResourceFromBenchmarkDirectory(resourcePath)
    591     dir = Pathname.new(".")
    592     $benchmarkDirectory.each_filename {
    593         | pathComponent |
    594         dir += ".."
    595     }
    596     dir + resourcePath
     602    $bundleResourcePathCache[[resourcePath, $benchmarkDirectory, Pathname.new(".")]]
    597603end
    598604
Note: See TracChangeset for help on using the changeset viewer.