Changeset 276669 in webkit
- Timestamp:
- Apr 27, 2021, 3:06:32 PM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
Scripts/webkitpy/port/base.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r276654 r276669 1 2021-04-27 Sam Sneddon <gsnedders@apple.com> 2 3 Optimize Port._expected_baselines_for_suffixes 4 https://bugs.webkit.org/show_bug.cgi?id=225115 5 6 Reviewed by Jonathan Bedard. 7 8 This takes out the join() and splitext() calls from the inner loop as 9 they are loop invariant, and account for a large proportion of the 10 function's execution time. After this, exists() account for almost 11 all. 12 13 * Scripts/webkitpy/port/base.py: 14 (Port._expected_baselines_for_suffixes): 15 1 16 2021-04-27 Ryan Haddad <ryanhaddad@apple.com> 2 17 -
trunk/Tools/Scripts/webkitpy/port/base.py
r276038 r276669 385 385 def _expected_baselines_for_suffixes(self, test_name, suffixes, all_baselines=False, device_type=None): 386 386 baseline_search_path = self.baseline_search_path(device_type=device_type) + [self.layout_tests_dir()] 387 fs = self._filesystem 388 baseline_name_root = fs.splitext(test_name)[0] + '-expected' 387 389 388 390 baselines = [] 389 391 for platform_dir in baseline_search_path: 392 unsuffixed = fs.join(platform_dir, baseline_name_root) 390 393 for suffix in suffixes: 391 baseline_filename = self._filesystem.splitext(test_name)[0] + '-expected' + suffix392 if self._filesystem.exists(self._filesystem.join(platform_dir, baseline_filename)):394 if fs.exists(unsuffixed + suffix): 395 baseline_filename = baseline_name_root + suffix 393 396 baselines.append((platform_dir, baseline_filename)) 394 397 … … 400 403 401 404 for suffix in suffixes: 402 baselines.append((None, self._filesystem.splitext(test_name)[0] + '-expected'+ suffix))405 baselines.append((None, baseline_name_root + suffix)) 403 406 return baselines 404 407
Note:
See TracChangeset
for help on using the changeset viewer.