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

Issue 1955373003: Convert some for-in loops for performance (Closed)

Created:
4 years, 7 months ago by Brian Wilkerson
Modified:
4 years, 7 months ago
Reviewers:
Bob Nystrom, scheglov
CC:
reviews_dartlang.org
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+267 lines, -91 lines) Patch
M pkg/analyzer/lib/dart/ast/ast.dart View 2 chunks +18 lines, -6 lines 0 comments Download
M pkg/analyzer/lib/dart/ast/token.dart View 1 chunk +3 lines, -1 line 0 comments Download
M pkg/analyzer/lib/src/dart/ast/ast.dart View 10 chunks +44 lines, -15 lines 0 comments Download
M pkg/analyzer/lib/src/generated/element_resolver.dart View 2 chunks +8 lines, -2 lines 0 comments Download
M pkg/analyzer/lib/src/generated/resolver.dart View 32 chunks +119 lines, -44 lines 0 comments Download
M pkg/analyzer/lib/src/task/dart.dart View 17 chunks +75 lines, -23 lines 0 comments Download

Messages

Total messages: 7 (3 generated)
Brian Wilkerson
For-in loops cause a lot of the megamorphic dispatch, and at least one of these ...
4 years, 7 months ago (2016-05-09 17:48:10 UTC) #2
scheglov
LGTM
4 years, 7 months ago (2016-05-09 17:59:29 UTC) #3
Brian Wilkerson
Committed patchset #1 (id:1) manually as 61818c95a133bf6cf3a58095d8a78b6fca64e370 (presubmit successful).
4 years, 7 months ago (2016-05-09 18:01:20 UTC) #5
Bob Nystrom
4 years, 7 months ago (2016-05-09 18:15:23 UTC) #7
Message was sent while issue was closed.
DBC: When doing micro-optimization like this that makes code less idiomatic, I
think it's really helpful to leave a comment saying:

// Using a manual for loop instead of a for-in loop here because it makes
benchmark ___ X% faster.

Otherwise, someone will come along later and say, "Oh, I can clean this up to be
more idiomatic." and not realize or be able to measure that they've regressed
perf.

(Of course, there is also the larger question of why the most natural,
beautiful, idiomatic way to implement something is slower, but that's more a
question for our implementations.)

Powered by Google App Engine
This is Rietveld 408576698