1brc
1brc copied to clipboard
BRC Entry
Check List:
- [X ] Tests pass (
./test.sh <username>
) - [X ] All formatting changes by the build are committed
- [ X] Output matches that of calculate_average_baseline.sh
- Execution time:
- {2.298,2.438,2.204,2.213,2.823}; Average of middle 3: 2.316s
- Execution time of reference implementation: 2mins, 55sec
My machine: "Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz 3.70 GHz"
Hey @cliffclick, thank you so much for entering this challenge, it's an honor!
Does running ./test.sh cliffclick
complete on your machine? I see it hanging here:
Validating calculate_average_cliffclick.sh -- src/test/resources/samples/measurements-10000-unique-keys.txt
In addition, two operational requests at this point:
- Could you please make your launch script executable?
- I see you attribute copyright to your entry specifically to you. Is this strictly needed, or can we go with the "original authors" we've used for everything else? I'm fine either way, the license header checker will then just need some configuration to handle this entry specifically.
Fixed test cases. Also figured out when the test case checker was failing, because for me on windows it looks like it silently succeeds, when instead it has silently failed. :-(
My launch script is executable on my platform; I do not know why it would not be for you.
As for the "original authors", I do not know who that is, or what is means. I wrote all the code in the submission, except copying the liscence header and the 1-liner "calculate_average..." script. I did not copy/clone any code from either the baseline submission, nor any other submission. So AFAIK, I'm the only author, and I thought that should be explicit.
So AFAIK, I'm the only author, and I thought that should be explicit.
Ok, that is fair. I'll look into configuring the license checker so that this is adhered to. Thanks for clarifying!
Hey @cliffclick, sorry for the slight delay, we had to move to another machine for evaluation and there were just so many submissions overall. There's one more test case which was added to ensure compliance with the rules (allowed characters) which is failing with this implementation right now:
Validating calculate_average_cliffclick.sh -- src/test/resources/samples/measurements-dot.txt
Exception in thread "Thread-0" java.lang.IndexOutOfBoundsException
at java.base/java.nio.Buffer$1.apply(Buffer.java:757)
at java.base/java.nio.Buffer$1.apply(Buffer.java:754)
at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:213)
at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:210)
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
at java.base/java.nio.Buffer.checkIndex(Buffer.java:779)
at java.base/java.nio.DirectByteBuffer.getLong(DirectByteBuffer.java:877)
at dev.morling.onebrc.CalculateAverage_cliffclick.do_chunk(CalculateAverage_cliffclick.java:143)
at dev.morling.onebrc.CalculateAverage_cliffclick.tstart(CalculateAverage_cliffclick.java:107)
at dev.morling.onebrc.CalculateAverage_cliffclick$1.run(CalculateAverage_cliffclick.java:75)
real 0m0.101s
user 0m0.134s
sys 0m0.021s
1c1
< {-=1.0/1.0/1.0, .=1.0/1.0/1.0}
---
> {-=1.0/1.5/2.0, .=1.0/1.0/1.0}
Could you rebase to current main, run the tests and ensure it passes? Thx! Apart from that, the current runtime on the new evaluation machine is 00:05.120, i.e. in the top 10 :)
Fixed bug
All tests passing now and it yields the expected result. 00:04.741 on the evaluation machine, very nice!