|
| 1 | +# 1brc in go |
| 2 | + |
| 3 | +It uses Docker with BuildKit plugin to build and [export binary](https://docs.docker.com/engine/reference/commandline/build/#output) binary, |
| 4 | +see [prepare_AlexanderYastrebov.sh](../../../../prepare_AlexanderYastrebov.sh) |
| 5 | +and [calculate_average_AlexanderYastrebov.sh](../../../../calculate_average_AlexanderYastrebov.sh). |
| 6 | + |
| 7 | +Demo: |
| 8 | +```sh |
| 9 | +$ ./test.sh AlexanderYastrebov |
| 10 | +[+] Building 0.2s (9/9) FINISHED |
| 11 | + => [internal] load .dockerignore 0.0s |
| 12 | + => => transferring context: 2B 0.0s |
| 13 | + => [internal] load build definition from Dockerfile 0.0s |
| 14 | + => => transferring dockerfile: 172B 0.0s |
| 15 | + => [internal] load metadata for docker.io/library/golang:latest 0.0s |
| 16 | + => [internal] load build context 0.0s |
| 17 | + => => transferring context: 145B 0.0s |
| 18 | + => [build-stage 1/3] FROM docker.io/library/golang 0.0s |
| 19 | + => CACHED [build-stage 2/3] COPY . src/ 0.0s |
| 20 | + => CACHED [build-stage 3/3] RUN cd src && go build . 0.0s |
| 21 | + => CACHED [export-stage 1/1] COPY --from=build-stage /go/src/1brc / 0.0s |
| 22 | + => exporting to client directory 0.1s |
| 23 | + => => copying files 2.03MB 0.0s |
| 24 | +Validating calculate_average_AlexanderYastrebov.sh -- src/test/resources/samples/measurements-10000-unique-keys.txt |
| 25 | +Validating calculate_average_AlexanderYastrebov.sh -- src/test/resources/samples/measurements-10.txt |
| 26 | +Validating calculate_average_AlexanderYastrebov.sh -- src/test/resources/samples/measurements-1.txt |
| 27 | +Validating calculate_average_AlexanderYastrebov.sh -- src/test/resources/samples/measurements-20.txt |
| 28 | +Validating calculate_average_AlexanderYastrebov.sh -- src/test/resources/samples/measurements-2.txt |
| 29 | +Validating calculate_average_AlexanderYastrebov.sh -- src/test/resources/samples/measurements-3.txt |
| 30 | +Validating calculate_average_AlexanderYastrebov.sh -- src/test/resources/samples/measurements-boundaries.txt |
| 31 | +Validating calculate_average_AlexanderYastrebov.sh -- src/test/resources/samples/measurements-complex-utf8.txt |
| 32 | +Validating calculate_average_AlexanderYastrebov.sh -- src/test/resources/samples/measurements-dot.txt |
| 33 | +Validating calculate_average_AlexanderYastrebov.sh -- src/test/resources/samples/measurements-shortest.txt |
| 34 | +Validating calculate_average_AlexanderYastrebov.sh -- src/test/resources/samples/measurements-short.txt |
| 35 | + |
| 36 | +# Run once to setup the benchmark |
| 37 | +# ./create_measurements.sh 1000000000 |
| 38 | +# mv measurements.txt measurements_1B.txt |
| 39 | +# ln -s measurements_1B.txt measurements.txt |
| 40 | +# ./calculate_average_baseline.sh > out_expected.txt |
| 41 | + |
| 42 | +$ wc -l measurements_1B.txt |
| 43 | +1000000000 measurements_1B.txt |
| 44 | + |
| 45 | +$ ./evaluate2.sh AlexanderYastrebov royvanrijn |
| 46 | +... 0.0s |
| 47 | +Benchmark 1: ./calculate_average_AlexanderYastrebov.sh 2>&1 |
| 48 | + Time (mean ± σ): 16.786 s ± 0.545 s [User: 56.030 s, System: 10.068 s] |
| 49 | + Range (min … max): 15.918 s … 17.309 s 5 runs |
| 50 | +... |
| 51 | +Benchmark 1: ./calculate_average_royvanrijn.sh 2>&1 |
| 52 | + Time (mean ± σ): 16.731 s ± 0.190 s [User: 56.485 s, System: 10.279 s] |
| 53 | + Range (min … max): 16.490 s … 16.951 s 5 runs |
| 54 | + |
| 55 | +Summary |
| 56 | + AlexanderYastrebov: trimmed mean 16.901712789513336, raw times 16.69836470718,17.30911065018,16.83413600418,15.91787706218,17.17263765718 |
| 57 | + royvanrijn: trimmed mean 16.738037123633333, raw times 16.4900939703,16.9513459953,16.5794539913,16.8297746273,16.8048827523 |
| 58 | +``` |
0 commit comments