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

Issue 225783006: Make the command cache use the directory name as part of the cache key (Closed)

Created:
6 years, 8 months ago by Mark Mentovai
Modified:
6 years, 7 months ago
Reviewers:
Nico
CC:
gyp-developer_googlegroups.com, scottmg, sky
Visibility:
Public.

Description

Make the command cache use the directory name as part of the cache key. Some commands are sensitive to the directory they're executed from. Chrome's Mojo is trying to use such a command. This makes GYP about 10% slower on my Mac laptop when running on Chrome, which is to say that it's not actually noticeably worse, because it was already so bad. Out of 2,413 command executions, there were formerly 475 cache misses; this change adds another 1,596. I looked at the sorts of commands that are now missing and the majority of them (879) are dir_exists.py followed by a relative path, and those expansions are very incorrect to look up from the cache. The next biggest buckets are 252 "echo -n ${HOME}/goma", 220 find_sdk.py, and another 220 plugin_flags.sh with an absolute directory argument, and none of these are sensitive to the working directory. Finally, there are 9 version.py invocations that are sensitive to the working directory. The numbers don't add up because I examined different statistics during different runs, and parallelism means that caching behavior is slightly different on successive runs. Considering that over half of the existing cache hits are dangerous, I'm inclined to make this change from a correctness perspective over performance concerns. Meanwhile, we should find a way to limit the time impact of the big callees here. dir_exists.py, find_sdk.py, plugin_flags.sh, and the goma finder might all perform better if migrated to pymod_do_main. BUG=112, 418 TEST=gyptest.py test/variables/commands/gyptest-commands-repeated-multidir.py Committed: https://code.google.com/p/gyp/source/detail?r=1913

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+112 lines, -6 lines) Patch
M pylib/gyp/input.py View 1 chunk +4 lines, -6 lines 0 comments Download
A test/variables/commands/gyptest-commands-repeated-multidir.py View 1 chunk +25 lines, -0 lines 0 comments Download
A test/variables/commands/repeated_multidir/dir_1/test_1.gyp View 1 chunk +14 lines, -0 lines 0 comments Download
A test/variables/commands/repeated_multidir/dir_2/test_2.gyp View 1 chunk +14 lines, -0 lines 0 comments Download
A test/variables/commands/repeated_multidir/main.gyp View 1 chunk +17 lines, -0 lines 0 comments Download
A test/variables/commands/repeated_multidir/print_cwd_basename.py View 1 chunk +12 lines, -0 lines 0 comments Download
A test/variables/commands/repeated_multidir/repeated_command_common.gypi View 1 chunk +26 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Mark Mentovai
6 years, 8 months ago (2014-04-04 16:51:34 UTC) #1
Mark Mentovai
Any thoughts here?
6 years, 8 months ago (2014-04-08 18:54:37 UTC) #2
Mark Mentovai
Nico, are you planning on reviewing this? If not, I’ll find someone else to look ...
6 years, 7 months ago (2014-05-02 13:15:29 UTC) #3
Daniel Bratell
On 2014/05/02 13:15:29, Mark Mentovai wrote: > Nico, are you planning on reviewing this? If ...
6 years, 7 months ago (2014-05-05 12:31:23 UTC) #4
Mark Mentovai
6 years, 7 months ago (2014-05-05 16:23:45 UTC) #5
Message was sent while issue was closed.
Committed patchset #1 manually as r1913.

Powered by Google App Engine
This is Rietveld 408576698