Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Issue 1957483004: GN: Don't import a file more than once. (Closed)

Created:
4 years, 7 months ago by brettw
Modified:
4 years, 7 months ago
Reviewers:
Nico
CC:
chromium-reviews, Dirk Pranke, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

GN: Don't import a file more than once. GN caches the results of imports so we don't have to load them more than once. But if two BUILD files load the same import at the same time, there is a race Previously GN would resolve the winner after the import ran on the assumption that imports are fast and collisions are rare. But some imports run expensive scripts meaning they take a long time and collisions are likely. The result is that a file can get imported more than once. This patch adds extra locking around the import to block other threads and only do the import once. Increase the minimum thread count for low-end systems to 8. This gives the fastest running time on an older MacBook. Both the import change and the thread change independently speed up GN on Mac Chrome by 150-300ms, so actual improvement should be 300-600ms. On beefy Windows and Linux workstations, there seems to be no change in performance with these changes, although the import change should help some worst-case situations. BUG=599892 Committed: https://crrev.com/a5b852cfbe6b6912ee6d1af145cbe9c090e40b42 Cr-Commit-Position: refs/heads/master@{#392353}

Patch Set 1 #

Patch Set 2 : threads #

Total comments: 1

Patch Set 3 : typo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -30 lines) Patch
M tools/gn/import_manager.h View 1 chunk +5 lines, -2 lines 0 comments Download
M tools/gn/import_manager.cc View 3 chunks +46 lines, -26 lines 0 comments Download
M tools/gn/scheduler.cc View 1 2 1 chunk +5 lines, -2 lines 0 comments Download

Messages

Total messages: 16 (8 generated)
brettw
4 years, 7 months ago (2016-05-06 21:27:59 UTC) #3
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1957483004/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1957483004/20001
4 years, 7 months ago (2016-05-06 21:28:27 UTC) #5
Nico
lgtm https://codereview.chromium.org/1957483004/diff/20001/tools/gn/scheduler.cc File tools/gn/scheduler.cc (right): https://codereview.chromium.org/1957483004/diff/20001/tools/gn/scheduler.cc#newcode60 tools/gn/scheduler.cc:60: // The minimum thread count is based on ...
4 years, 7 months ago (2016-05-06 21:33:51 UTC) #6
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-06 22:23:13 UTC) #8
brettw
typo
4 years, 7 months ago (2016-05-09 17:02:26 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1957483004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1957483004/40001
4 years, 7 months ago (2016-05-09 17:03:00 UTC) #12
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 7 months ago (2016-05-09 17:41:10 UTC) #14
commit-bot: I haz the power
4 years, 7 months ago (2016-05-09 17:42:38 UTC) #16
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/a5b852cfbe6b6912ee6d1af145cbe9c090e40b42
Cr-Commit-Position: refs/heads/master@{#392353}

Powered by Google App Engine
This is Rietveld 408576698