gunnarmorling / 1brc

1️⃣🐝🏎️ The One Billion Row Challenge -- A fun exploration of how quickly 1B rows from a text file can be aggregated with Java
https://www.morling.dev/blog/one-billion-row-challenge/
Apache License 2.0
6.08k stars 1.83k forks source link

sudhirtumati implementation #598

Closed sudhirtumati closed 7 months ago

sudhirtumati commented 7 months ago

Check List:

My PC configuration:

gunnarmorling commented 7 months ago

Produces incorrect output for the 1B file:

Validating calculate_average_sudhirtumati.sh -- measurements_1B.txt
6c6
< Adelaide;-34.2;17.2;67.1
---
> Adelaide;-34.2;17.3;67.1
31c31
< Baghdad;-30.2;22.7;70.2
---
> Baghdad;-30.2;22.8;70.2
142c142
< Hamilton;-34.7;18.0;73.1
---
> Hamilton;-34.7;18.1;73.1
191c191
< La Ceiba;-22.5;26.1;75.2
---
> La Ceiba;-22.5;26.2;75.2

FAILURE: ./test.sh sudhirtumati measurements_1B.txt failed
sudhirtumati commented 7 months ago
./test.sh sudhirtumati

Using java version 21.0.2-open in this shell.
Validating calculate_average_sudhirtumati.sh -- src/test/resources/samples/measurements-1.txt
Validating calculate_average_sudhirtumati.sh -- src/test/resources/samples/measurements-10.txt
Validating calculate_average_sudhirtumati.sh -- src/test/resources/samples/measurements-10000-unique-keys.txt
Validating calculate_average_sudhirtumati.sh -- src/test/resources/samples/measurements-2.txt
Validating calculate_average_sudhirtumati.sh -- src/test/resources/samples/measurements-20.txt
Validating calculate_average_sudhirtumati.sh -- src/test/resources/samples/measurements-3.txt
Validating calculate_average_sudhirtumati.sh -- src/test/resources/samples/measurements-boundaries.txt
Validating calculate_average_sudhirtumati.sh -- src/test/resources/samples/measurements-complex-utf8.txt
Validating calculate_average_sudhirtumati.sh -- src/test/resources/samples/measurements-dot.txt
Validating calculate_average_sudhirtumati.sh -- src/test/resources/samples/measurements-rounding.txt
Validating calculate_average_sudhirtumati.sh -- src/test/resources/samples/measurements-short.txt
Validating calculate_average_sudhirtumati.sh -- src/test/resources/samples/measurements-shortest.txt

This is the output of test execution on my environment. I do not see measurements_1B.txt file under `src/main/resources/samples' directory.

Could you please make measurements_1B.txt available for me to reproduce the issue?

gunnarmorling commented 7 months ago

That file is 13 G, so it's a bit hard to share. You can create it yourself using create_measurements.sh (for the standard eval file) and create_measurements3.sh (for the 10K key set file). Your implementation must show the same output for those as the base line (or compare to output of the top of the leaderboard who are known to be correct and will complete much faster).

sudhirtumati commented 7 months ago

Noted @gunnarmorling

Unfortunately, I couldn't reproduce the error in my environment. The output generated by my implementation is identical with the baseline. I am sure there must be an issue with the implementation as the same code is not working in your environment. I suspect thread contention might be resulting in incorrect map updates.

Modified my implementation to reduce thread contention to the extent possible. Total processing time (with 1B rows) also came down from ~40 seconds to ~30 seconds on my personal laptop.

Test suite execution is successful. In addition to the test suite, I ran tests with multiple files with different row counts (.5m, 1m, 10m, 50, 100, 500m, 1B) and found that the results are identical to the baseline output.

gunnarmorling commented 7 months ago

Hey, can you please rebase this to latest main and squash everything into one commit? There should be no unrelated commits in this PR.

sudhirtumati commented 7 months ago

Done. Please check

gunnarmorling commented 7 months ago

00:25.064.