My day 1 solution in common code: <https://github....
# advent-of-code
j
My day 1 solution in common code: https://github.com/jorispz/aoc-2020/blob/master/src/commonMain/kotlin/day1/p01.kt I had a lot of frustrating infrastructure issues. My existing IntelliJ run configuration somehow got corrupted, which took me ages to figure out. Then, my native build didn't work, exited quietly without throwing any kind of error or stacktrace, just an exit code which hinted at a null pointer. The solution isn't particularly nice or clean, but it's been enough for today 🙂 Below the timing measurements for JVM (OpenJDK11), NodeJS and native. (The times were drastically improved by some preprocessing on the input which you can find on line 9 in the source)
💪 2
👍 1
m
Nice, I've never noticed there is a Triple class, was sure you just defined it yourself for a moment.
j
Ha, yeah, it does indeed look like something from a AoC utility file 🙂
r
really neat helper
without
function
j
Thanks! I really love extension functions for these little helpers
e
JMH benchmark results for my solution: https://ephemient.github.io/aoc2020/results.txt
j
Nice!
t
Very cool!!
b
How did you measure times here? using a benchmarking harness? It looks like there is quite a lot of caching happening in your JVM solution
note, jmh gradle plugin is incompatible with java 14, so make sure you're using java 11 or something like that. https://github.com/melix/jmh-gradle-plugin/issues/175
b
I was talking about the OP, but thanks for shaning your config, I wanted to play with jmh. I'm reading Scott Oaks book about Java Performance but still didn't get to the practice of all of that
e
ah. given how the native timing is relatively flat while the JVM and JS timings decrease, I would assume it's due to JIT rather than caching
b
yeah that make sense. Have a look at what I did
seems to be pretty fast
I would be curious if you could run that with jmh
so yes of course calculating part 1 and 2 together helps a lot too
thanks
I'm trying to set it up now