Skip to content

Commit 79aeed8

Browse files
java-team-github-botDagger Team
authored andcommitted
Set MAX_STATEMENTS_PER_METHOD to 25 based on performance analysis.
RELNOTES=n/a PiperOrigin-RevId: 638462173
1 parent b96e9bf commit 79aeed8

File tree

2 files changed

+122
-103
lines changed

2 files changed

+122
-103
lines changed

java/dagger/internal/codegen/writing/ComponentImplementation.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,12 @@ private static ImmutableList<ImmutableList<Binding>> bindingPartitions(
246246
/**
247247
* How many statements per {@code initialize()} or {@code onProducerFutureCancelled()} method
248248
* before they get partitioned.
249+
*
250+
* <p>This value has been set based on empirical performance analysis. If this number is too
251+
* large, some Android runtimes will not ahead-of-time compile the generated code. See
252+
* b/316617683.
249253
*/
250-
private static final int STATEMENTS_PER_METHOD = 100;
254+
private static final int STATEMENTS_PER_METHOD = 25;
251255

252256
private final ShardImplementation componentShard;
253257
private final Supplier<ImmutableMap<Binding, ShardImplementation>> shardsByBinding;

0 commit comments

Comments
 (0)