second try: just testing with the chunk size and gc tunning

This commit is contained in:
Rafael Merino García 2024-01-12 19:02:31 +01:00 committed by Gunnar Morling
parent 9e5ec51315
commit ab9d64b3e3
2 changed files with 3 additions and 2 deletions

View File

@ -15,7 +15,7 @@
# limitations under the License. # limitations under the License.
# #
JAVA_OPTS="" JAVA_OPTS="-Xms1024m -Xms1024m -XX:+UseParallelGC -XX:MaxHeapFreeRatio=10 -XX:ParallelGCThreads=2"
CHUNK_SIZE=$((8 * 1024 * 1024)) CHUNK_SIZE=$((50 * 1024 * 1024))
java $JAVA_OPTS --class-path target/average-1.0.0-SNAPSHOT.jar \ java $JAVA_OPTS --class-path target/average-1.0.0-SNAPSHOT.jar \
dev.morling.onebrc.CalculateAverage_imrafaelmerino $CHUNK_SIZE dev.morling.onebrc.CalculateAverage_imrafaelmerino $CHUNK_SIZE

View File

@ -144,6 +144,7 @@ public class CalculateAverage_imrafaelmerino {
var field = new byte[FIELD_SIZE]; var field = new byte[FIELD_SIZE];
while (bb.position() < limit) { while (bb.position() < limit) {
var fieldCurrentIndex = 0; var fieldCurrentIndex = 0;
field[fieldCurrentIndex++] = bb.get();
while (bb.position() < limit) { while (bb.position() < limit) {
var fieldByte = bb.get(); var fieldByte = bb.get();
if (fieldByte == ';') if (fieldByte == ';')