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

Issue 1727773002: [Swarming] work around slow calls in archive.py (Closed)

Created:
4 years, 10 months ago by Stefano Sanfilippo
Modified:
4 years, 10 months ago
Reviewers:
Michael Achenbach
CC:
v8-reviews_googlegroups.com, tandrii(chromium)
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[Swarming] work around slow calls in archive.py Apparently, the tarfile Python module spends a lot of time in grp.getgrid for retrieving a piece information (the name of the primary group) which we don't need anyway. There is no proper way to disable these slow calls, but there's a workaround which relies on the way in which grp (and pwd) is used. In fact, pwd and grp are imported in this fashion: try: import grp, pwd except ImportError: grp = pwd = None and then used with the following pattern [2]: if grp: try: tarinfo.gname = grp.getgrgid(tarinfo.gid)[0] except KeyError: pass By setting grp and pwd to None, thus skipping the calls, I was able to achieve a 35x speedup on my workstation. The user and group names are set to test262 when building the tar. The downside to this approach is that we are relying on an implementation detail, which is not in the public API. However, the blamelist shows that the relevant bits of the module have not been updated since 2003 [3], so we might as well assume that the workaround will keep working, on cPython 2.x at least. --- [1] https://hg.python.org/cpython/file/2.7/Lib/tarfile.py#l56 [2] https://hg.python.org/cpython/file/2.7/Lib/tarfile.py#l1933 [3] https://hg.python.org/cpython/rev/f9a5ed092660 BUG=chromium:535160 LOG=N Committed: https://crrev.com/1c1b70c98d9231bf1606127796a57459aebba481 Cr-Commit-Position: refs/heads/master@{#34245}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -0 lines) Patch
M test/test262/archive.py View 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (11 generated)
Stefano Sanfilippo
Here is the fix we discussed by e-mail. It's a workaround, so I understand if ...
4 years, 10 months ago (2016-02-23 19:39:44 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1727773002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1727773002/1
4 years, 10 months ago (2016-02-23 19:45:24 UTC) #9
Michael Achenbach
I love work-arounds! Lets see if it works...
4 years, 10 months ago (2016-02-23 19:47:16 UTC) #10
Michael Achenbach
On 2016/02/23 19:47:16, Michael Achenbach wrote: > I love work-arounds! Lets see if it works... ...
4 years, 10 months ago (2016-02-23 19:54:40 UTC) #11
Michael Achenbach
Wonder if this has the desired effect. According to the compiler stats, taring still takes ...
4 years, 10 months ago (2016-02-23 19:58:24 UTC) #12
Michael Achenbach
On 2016/02/23 19:58:24, Michael Achenbach wrote: > Wonder if this has the desired effect. According ...
4 years, 10 months ago (2016-02-23 20:01:18 UTC) #13
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-23 20:05:55 UTC) #15
Stefano Sanfilippo
On 2016/02/23 20:01:18, Michael Achenbach wrote: > On 2016/02/23 19:58:24, Michael Achenbach wrote: > > ...
4 years, 10 months ago (2016-02-24 01:30:42 UTC) #16
Michael Achenbach
On 2016/02/24 01:30:42, ssanfilippo wrote: > On 2016/02/23 20:01:18, Michael Achenbach wrote: > > On ...
4 years, 10 months ago (2016-02-24 07:21:33 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1727773002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1727773002/1
4 years, 10 months ago (2016-02-24 11:02:07 UTC) #19
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 10 months ago (2016-02-24 11:04:06 UTC) #21
commit-bot: I haz the power
4 years, 10 months ago (2016-02-24 11:04:30 UTC) #23
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/1c1b70c98d9231bf1606127796a57459aebba481
Cr-Commit-Position: refs/heads/master@{#34245}

Powered by Google App Engine
This is Rietveld 408576698