finalThread[] threads = newThread[numberOfThreads]; for (int t = 0; t < threads.length; t++) {
threads[t] = newThread(new Main(t));
threads[t].start();
} for (Thread t : threads) {
t.join();
}
System.out.println("Finishing");
}
public String $noinline$run0() { // Prevent inlining. if (sFlag) { thrownew Error();
} char[] arr = {'a', 'b', 'c'};
String str = new String(arr, 0, arr.length); if (!str.equals("abc")) {
System.out.println("Failure 1! " + str);
System.exit(0);
} return str;
}
publicvoid run() { if (threadIndex == 0) { // This thread keeps doing deoptimization of all threads. // Hopefully that will trigger one deoptimization when returning from // StringFactory.newEmptyString() in one of the other threads. for (int i = 0; i < totalOperations; ++i) { if (i % 50 == 0) {
deoptimizeAll();
} if (i % 50 == 25) {
undeoptimizeAll();
}
}
done = true;
} else { // This thread keeps doing new String() from a char array. while (!done) {
String str = $noinline$run0(); if (!str.equals("abc")) {
System.out.println("Failure 2! " + str);
System.exit(0);
}
}
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.