Last active
December 19, 2015 19:28
-
-
Save ben-manes/6005989 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class FinalizeBenchmark extends Benchmark { | |
public int timeFinalize(int reps) { | |
int dummy = 0; | |
for (int i = 0; i < reps; i++) { | |
Object o = new Object() { | |
@Override protected void finalize() { | |
toString(); | |
} | |
}; | |
dummy = o.hashCode(); | |
} | |
return dummy; | |
} | |
public static void main(String[] args) throws Exception { | |
CaliperMain.main(FinalizeBenchmark.class, args); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This selection yields 2 experiments. | |
Starting experiment 1 of 2: {instrument=allocation, method=Finalize, vm=default, parameters={}} | |
Complete! | |
Starting experiment 2 of 2: {instrument=micro, method=Finalize, vm=default, parameters={}} | |
ERROR: Trial failed to complete (its results will not be included in the run): | |
Trial exceeded the total allowable runtime (30s). The limit may be adjusted using the --time-limit flag. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment