Use a set when calling removeAll
removeAll on an IdentiyHashSet will do contains checks on the passed in collection
This has a massive impact on the runtime of youtube 14, basically cutting the compile time in half.
I will try to grep for more places where we pass a list to a removeAll call on an IdentityHashSet
Bug: 132420434
Change-Id: Iaf183e4f6a61b0d1dae4fb4f19d61ba48ee19330
diff --git a/src/main/java/com/android/tools/r8/shaking/Enqueuer.java b/src/main/java/com/android/tools/r8/shaking/Enqueuer.java
index 7582343..57290f9 100644
--- a/src/main/java/com/android/tools/r8/shaking/Enqueuer.java
+++ b/src/main/java/com/android/tools/r8/shaking/Enqueuer.java
@@ -317,7 +317,7 @@
pinnedItems.stream()
.filter(DexReference::isDexField)
.map(DexReference::asDexField)
- .collect(Collectors.toList()));
+ .collect(Collectors.toSet()));
return result;
}