Skip to content

Commit 735b386

Browse files
andreaTPclaude
andcommitted
Revert 3rd noop, test with only 10k iterations + 2 noops
Previous run (3 noops + 10k) was 20/20 green. Testing whether the iteration count alone is sufficient without the extra noop. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 979c672 commit 735b386

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

‎runtime/src/main/java/run/endive/runtime/MemCopyWorkaround.java‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,20 @@ public static boolean shouldUseMemWorkaround(String version) {
4545
if (shouldUseMemWorkaround()) {
4646
MemoryCopyFunc noop1 = (destination, offset, size, memory) -> {};
4747
MemoryCopyFunc noop2 = (destination, offset, size, memory) -> {};
48-
MemoryCopyFunc noop3 = (destination, offset, size, memory) -> {};
4948

50-
I32GEUFunc noop4 = (a, b) -> a;
51-
I32GEUFunc noop5 = (a, b) -> b;
52-
I32GEUFunc noop6 = (a, b) -> a + b;
49+
I32GEUFunc noop3 = (a, b) -> a;
50+
I32GEUFunc noop4 = (a, b) -> b;
5351

5452
// Warm up the JIT... to make it see memoryCopyFunc.apply is megamorphic
5553
for (int i = 0; i < 10_000; i++) {
5654
memoryCopyFunc = noop1;
5755
MemCopyWorkaround.memoryCopy(0, 0, 0, null);
5856
memoryCopyFunc = noop2;
5957
MemCopyWorkaround.memoryCopy(0, 0, 0, null);
60-
memoryCopyFunc = noop3;
61-
MemCopyWorkaround.memoryCopy(0, 0, 0, null);
6258

63-
i32geuFunc = noop4;
59+
i32geuFunc = noop3;
6460
MemCopyWorkaround.i32_ge_u(0, 0);
65-
i32geuFunc = noop5;
66-
MemCopyWorkaround.i32_ge_u(0, 0);
67-
i32geuFunc = noop6;
61+
i32geuFunc = noop4;
6862
MemCopyWorkaround.i32_ge_u(0, 0);
6963
}
7064

0 commit comments

Comments
 (0)