See issue #31470
The performance numbers from the example in that issue improved as follows:
Before:
Set.first 2669 ms
Set.last 15509 ms
HashSet.first 2845 ms
HashSet.last 22053 ms
After:
Set.first 1244 ms
Set.last 1422 ms
HashSet.first 1075 ms
HashSet.last 4552 ms
Bug: http://dartbug.com/31470
Change-Id: I8afc91ad8835ac18bcc37737570c7f4be0bb6e8a
Reviewed-on: https://dart-review.googlesource.com/44782
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Corry <erikcorry@google.com>
Changes signature of Iterable.singleWhere.
Makes LinkedHashMap no longer be a HashMap.
Change-Id: Ibd7e56e1ac03cb9fb10d19d1328d452fcd06d89f
Reviewed-on: https://dart-review.googlesource.com/32541
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Notes on test changes:
- This revealed runtime failures in some tests in
pkg/front_end/testcases/inference. Since these tests were never
meant to exercise runtime behavior in the first place, I just
changed them so that main() does nothing.
- This revealed runtime failures in some tests in tests/language_2.
These tests began failing because they used "var" for a fields and
then later assigned a value to the field that was incompatible with
the inferred type. It looks like the intent was for these fields to
have type "dynamic", so I changed the tests accordingly.
Change-Id: I0ddb2063427b52b5e4be1884fa333e25be4bf4f3
Reviewed-on: https://dart-review.googlesource.com/16881
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Parameterize hash map entries and iterators with appropriate type arguments.
Cleanup code that was declaring local variables with unnecessary explicit types,
while at the same time dropping relevant type arguments (e.g. List instead of
List<_HashMapEntry<K, V>>).
Bug: https://github.com/dart-lang/sdk/issues/31052
Change-Id: I420e84e9ba549d7a9713970c85dbccc19d26761f
Reviewed-on: https://dart-review.googlesource.com/15121
Reviewed-by: Erik Corry <erikcorry@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Fix observatory tests broken by running dartfmt due to line and column changes.
Temporarily reverted formatting for evaluate_activation_test.dart as dartfmt doesn't yet handle multitests.
BUG=
R=johnmccutchan@google.com
Review-Url: https://codereview.chromium.org/2759973004 .
I've omitted files where the formatter output is significantly uglier
than the original code and I'll send those files in a separate CL
with options for how to make the code look reasonable while still
taking advantage of the formatter.
BUG=
R=johnmccutchan@google.com
Review-Url: https://codereview.chromium.org/2751423005 .
This should help least-upper-bound computations to not think of EfficientLength
as completely separate from Iterable even though they are always used together.
It doesn't solve all problems with the least-upper-bound computation,
but at least some of the more often occuring ones.
R=floitsch@google.com
Review URL: https://codereview.chromium.org/2467113003 .
- bring patched SDK generation scripts and VM patch tweaks that allow VM patch files to be parsed by analyzer front-end;
Patched SDK is an SDK with all VM patches spliced into it. Kernel compiler is based on the analyzer front-end which does
not have any patch files support/model so for it to produce Kernel files that match VM we need to generate a such patched SDKs.
- bring test script modifications that allow to test Kernel pipeline
BUG=
R=asiva@google.com, kmillikin@google.com, whesse@google.com, zra@google.com
Review URL: https://codereview.chromium.org/2434123003 .
Allow members of patch classes to be annotated with @patch. The VM
ignores the annotation. I simply replaces the original method
if the name matches, or reports an error if field names match.
Adding a bit is_patched to members to do more checking remains a
TODO. There are currently no unused bits available, and I don’t want
to increase the size of Function objects for this.
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org/2230383003 .
Annotate patch classes and top-level patch functions with @patch
instead of the pseudo-keyword patch. This allows the analyzer
to read patch files, and matches the syntax that dart2js uses.
The deprecated syntax is still supported, but a warning is printed when detected.
BUG=
Review URL: https://codereview.chromium.org/2220883004 .
It's still not a good solution for detecting an Iterable with an efficient
length. It's not inherited by, e.g., a DelegatingIterable wrapper or similar
generic Iterable transformers.
Keep this as an internal optimization for quickly detecting the most common
efficient-length Iterable classes (List, Set, Queue, Map.keys/values), but
don't make it public.
A *real* solution would be adding a hasEfficientLength getter to Iterable, or
adding an efficientLength getter that may return null if it's not efficient.
This would something that a wrapper can attach to.
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//1154263003
Make the compact linked hash map, which is the default implementation for Map
(including map literals), a VM-internal class.
This makes it easy to have more efficient serialization of maps (although for
now, the implementation is straight-forward).
Refactor the compact hash class hierarchy to enable the VM-internal class and
the rest (also the Set classes) to share a maximal amount of code, by using
two different bases for implicit/explicit fields.
Remove existing proof-of-concept, C++-based internal VM-class.
BUG=http://dartbug.com/22982R=asiva@google.com
Review URL: https://codereview.chromium.org//1151523002
Add GC-friendly replacement for default Map/Set:
* open-addressing hash table, avoiding the overhead of chained entries
* index separate from the keys/values, allowing more of it to fit in the cache
* new keys are always appended, to allow insertion-order iteration
* spare bits in index entries are used to store hashes
* index is typed data, so can be ignored by GC
Enable it with --use_compact_hash (disabled by default).
Reduces Dart2JS compilation time for huge codebase (N=200) by ~30%, due to reduced time in GC. Slightly slower for small maps and maps with deletions: json benchmarks regress by ~5%.
R=vegorov@google.com
Review URL: https://codereview.chromium.org//915323002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43840 260f80e4-7a28-3924-810f-c04153c831b5