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

Issue 2797253011: Improve json_comment_eater.py performance. (Closed)

Created:
3 years, 8 months ago by martijnc
Modified:
3 years, 8 months ago
Reviewers:
Dirk Pranke
CC:
chromium-reviews, lgarron
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Improve json_comment_eater.py performance. The JSON check in PRESUBMIT.py used to take ~3 minutes to complete on a large JSON file (e.g.: net/http/transport_security_state_static.h). This CL brings that down to a couple of seconds. Profiling showed that most time was lost in the string.find() call in _FindNextToken(). Old: Presubmit checks took 206.2s to calculate. New: Presubmit checks took 3.6s to calculate. BUG=697716 Review-Url: https://codereview.chromium.org/2797253011 Cr-Commit-Position: refs/heads/master@{#464042} Committed: https://chromium.googlesource.com/chromium/src/+/5a78808161cff2557d53f9278d1b93bcc2495f47

Patch Set 1 #

Total comments: 2

Patch Set 2 : Improve JSON comment eater performance. #

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

Messages

Total messages: 20 (14 generated)
martijnc
Hi, can you review this patch? Thanks!
3 years, 8 months ago (2017-04-08 18:16:29 UTC) #4
Dirk Pranke
lgtm if you file a bug per the comments. https://codereview.chromium.org/2797253011/diff/1/PRESUBMIT.py File PRESUBMIT.py (right): https://codereview.chromium.org/2797253011/diff/1/PRESUBMIT.py#newcode1418 PRESUBMIT.py:1418: ...
3 years, 8 months ago (2017-04-10 19:34:28 UTC) #7
martijnc
Can you take another look? I've updated the CL to fix the performance instead. Thanks! ...
3 years, 8 months ago (2017-04-11 20:18:13 UTC) #14
Dirk Pranke
Nice! Thanks for the improvements and the bug. lgtm.
3 years, 8 months ago (2017-04-11 21:36:40 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2797253011/40001
3 years, 8 months ago (2017-04-12 15:52:51 UTC) #17
commit-bot: I haz the power
3 years, 8 months ago (2017-04-12 15:59:42 UTC) #20
Message was sent while issue was closed.
Committed patchset #2 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/5a78808161cff2557d53f9278d1b...

Powered by Google App Engine
This is Rietveld 408576698