Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions BACKLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,8 @@ Notes; finished-work narrative does not.
waits for the parse threads, so the scan is not on the critical path while parsing is parallel.
- **What a large map's build still spends, by step (`-measure`), and why.** Measured on a Jass map of 1,625 files
with thousands of compile-time functions:
- *Type check (12 s):* Guava collections are about 11% of its samples (name tables about 5%, the dataflow states
about 4%). The dataflow anomaly analysis (`VarStates`, `VState`) copies its immutable maps and multimaps on every
read and write, about 7% with its merges; persistent or mutable states would remove most of that. The rest is
attribute evaluation, see the next item.
- *Type check (12 s):* the Guava name tables are about 5% of its samples; the rest is attribute evaluation, see
the next item.
- **Parallel type check and per-function IM passes.** Parsing is parallel (above); the rest of a build is not, and
JFR of fresh master says where the time is (shares of the compiler thread's samples, castle fight without
optimisations / optimised / zombie defense): type check light and heavy phases (attribute evaluation, per unit and per
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -584,51 +584,6 @@ public static <T> List<T> subList(List<T> l, int start, int stop) {
return result;
}

public static <K, V> ImmutableMap<K, V> mergeMaps(
ImmutableMap<K, V> a,
ImmutableMap<K, V> b,
Function2<V, V, V> mergeFunc) {
if (a.isEmpty()) return b;
if (b.isEmpty()) return a;

ImmutableMap.Builder<K, V> builder = ImmutableMap.builder();

for (Entry<K, V> e : a.entrySet()) {
K key = e.getKey();
if (b.containsKey(key)) {
builder.put(key, mergeFunc.apply(e.getValue(), b.get(key)));
} else {
builder.put(e);
}
}

for (Entry<K, V> e : b.entrySet()) {
K key = e.getKey();
if (!a.containsKey(key)) {
builder.put(e);
}
}

return builder.build();
}

public static <K, V> ImmutableSetMultimap<K, V> mergeMultiMaps(
ImmutableSetMultimap<K, V> a, ImmutableSetMultimap<K, V> b) {
if (a.isEmpty()) return b;
if (b.isEmpty()) return a;

ImmutableSetMultimap.Builder<K, V> builder = ImmutableSetMultimap.builder();
builder.putAll(a);
builder.putAll(b);
return builder.build();
}

public static <T> ImmutableSet<T> mergeSets(ImmutableSet<T> a, ImmutableSet<T> b) {
ImmutableSet.Builder<T> builder = ImmutableSet.builder();
builder.addAll(a).addAll(b);
return builder.build();
}

public static <T> T[] joinArrays(T[] a, T[] b) {
T[] res = Arrays.copyOf(a, a.length + b.length);
System.arraycopy(b, 0, res, a.length, b.length);
Expand Down
Loading
Loading