Bug 204211

Summary: run-webkit-tests loads committers.py 4 times, taking about 40ms
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Tools / TestsAssignee: Jonathan Bedard <jbedard>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, commit-queue, jbedard, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Simon Fraser (smfr) 2019-11-14 16:42:17 PST
diff --git a/Tools/Scripts/webkitpy/common/config/committers.py b/Tools/Scripts/webkitpy/common/config/committers.py
index 0d63ff67c1453120169b4b8652b97fbd15aee6df..df620d5594521e71a298207592b76d75ec9dad44 100644
--- a/Tools/Scripts/webkitpy/common/config/committers.py
+++ b/Tools/Scripts/webkitpy/common/config/committers.py
@@ -32,6 +32,7 @@
 import fnmatch
 import json
 import sys
+import time
 
 from functools import reduce
 from webkitpy.common.editdistance import edit_distance
@@ -194,7 +195,10 @@ class CommitterList(object):
         if committers or reviewers or contributors:
             self.load_test_data(committers, reviewers, contributors)
         else:
+            start = time.time()
             self.load_json()
+            end = time.time()
+            print 'Loading committers took {}ms'.format(1000 * (end - start))
 
         self._contributors_by_name = {}
         self._accounts_by_email = {}


Loading committers took 11.5311145782ms
Loading committers took 11.4798545837ms
Loading committers took 9.89007949829ms
Loading committers took 10.3440284729ms
Comment 1 Jonathan Bedard 2019-11-15 08:44:29 PST
Created attachment 383622 [details]
Patch
Comment 2 Jonathan Bedard 2019-11-15 08:45:34 PST
Unlike some of our other performance issues in webkitpy, this one is caused by doing something pretty blatantly against Python best practices that is also a very easy fix.
Comment 3 WebKit Commit Bot 2019-11-15 10:00:49 PST
Comment on attachment 383622 [details]
Patch

Clearing flags on attachment: 383622

Committed r252489: <https://trac.webkit.org/changeset/252489>
Comment 4 WebKit Commit Bot 2019-11-15 10:00:50 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2019-11-15 10:01:19 PST
<rdar://problem/57230884>