perf: reduce java-tracer E2E from ~75 min to ~15 min
Remove filterEvens and instanceMethod from the Workload fixture (4→2 functions) and reduce main() loop from 1000→100 rounds. The E2E test only needs to verify the tracer→optimizer pipeline works end-to-end; it doesn't need 4 functions or 1604 replay tests to prove that. Expected impact: ~2 functions × ~8 candidates × fewer replay tests should bring the job from ~75 min down to ~10-15 min.
This commit is contained in:
parent
5ee642e35e
commit
2b0f633c0f
1 changed files with 2 additions and 32 deletions
|
|
@ -1,8 +1,5 @@
|
|||
package com.example;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Workload {
|
||||
|
||||
public static int computeSum(int n) {
|
||||
|
|
@ -21,46 +18,19 @@ public class Workload {
|
|||
return result;
|
||||
}
|
||||
|
||||
public static List<Integer> filterEvens(List<Integer> numbers) {
|
||||
List<Integer> result = new ArrayList<>();
|
||||
for (int n : numbers) {
|
||||
if (n % 2 == 0) {
|
||||
result.add(n);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public int instanceMethod(int x, int y) {
|
||||
return x * y + computeSum(x);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// Run methods with large inputs so JFR can capture CPU samples.
|
||||
// Small inputs finish too fast (<1ms) for JFR's 10ms sampling interval.
|
||||
for (int round = 0; round < 1000; round++) {
|
||||
// 100 rounds is enough for JFR to collect ~10 samples per function.
|
||||
for (int round = 0; round < 100; round++) {
|
||||
computeSum(100_000);
|
||||
repeatString("hello world ", 1000);
|
||||
|
||||
List<Integer> nums = new ArrayList<>();
|
||||
for (int i = 1; i <= 10_000; i++) nums.add(i);
|
||||
filterEvens(nums);
|
||||
|
||||
Workload w = new Workload();
|
||||
w.instanceMethod(100_000, 42);
|
||||
}
|
||||
|
||||
// Also call with small inputs for variety in traced args
|
||||
System.out.println("computeSum(100) = " + computeSum(100));
|
||||
System.out.println("repeatString(\"ab\", 3) = " + repeatString("ab", 3));
|
||||
|
||||
List<Integer> small = new ArrayList<>();
|
||||
for (int i = 1; i <= 10; i++) small.add(i);
|
||||
System.out.println("filterEvens(1..10) = " + filterEvens(small));
|
||||
|
||||
Workload w = new Workload();
|
||||
System.out.println("instanceMethod(5, 3) = " + w.instanceMethod(5, 3));
|
||||
|
||||
System.out.println("Workload complete.");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue