If anyone is still looking for a painless AOC2021 ...
# advent-of-code
b
If anyone is still looking for a painless AOC2021 workspace to dive straight to coding, look no further - https://github.com/mpetuska/aoc-2021-kmp Comes packed with testing framework, test inputs, execution time measurements and validation. Oh and it runs on ALL kotlin targets, which allows you to compare how your solution performs under different runtimes (GH actions included if you don't have 3 laptops) :D All you need to do is implement a single method for each day with your solution.
e
https://www.reddit.com/r/adventofcode/comments/k7pgm7/legalip_question/gest0pt/
The puzzle text, and all other content at adventofcode.com, is not licensed for reproduction or distribution.
Eric Wastl and the other admins have asked people to remove the puzzle text from their repos before.
b
Oh shit. Removing now.
Done, thanks for pointing this out.
e
no worries, just wanted to clear that up before your repo gets popular ๐Ÿ™‚
interesting how your setup is simpler and more complex than mine, in different ways - https://github.com/ephemient/aoc2021/tree/main/kt
b
It's hella complex so it would be simple for other people to clone and dive to code ๐Ÿ˜„
I was thinking of adding benchmarking too, but decided to settle for measureTime ๐Ÿ˜„
e
I filed a couple bugs against kotlinx.benchmark while trying to set it up in my repo, it seems not ready for primetime yet
b
I was quite surprised how much better native performs over jvm ๐Ÿ˜„
e
at this point there's relatively a lot of startup time cost, I expect JVM to have better throughput once it gets going
b
I'm not measuring that. With measureTime, i'm only measuring the execution of the solution
e
method JIT doesn't kick in until it's repeated though
b
i.e.
measureTime { solution() }
Ah, you're right.
p
Thank you for sharing your solutions. Already learned some new method usages.
b
Will push day 2 & 3 soon
๐Ÿ‘ 1
t
Yeah, they are serious about the puzzle text too. I used to publish them in my blog and they called me out over twitter (which, I get, but they totally could have emailed me or DMd me or whatever).
b
D2 & D3 are out
j
This is very nice! I don't have the time to participate this year, but I used to compile to JVM, JS and native and calculate elapsed time as well. @ephemient is correct, the JIT makes a huge difference after a few runs, and easily outperforms native in that context. See for example https://github.com/jorispz/aoc-2020 and https://github.com/jorispz/aoc-2019 for some test results
๐Ÿ‘๐Ÿป 1
t
I'll miss your solutions this year @Joris PZ ๐Ÿ˜ž But I know you're busy.
e
https://ephemient.github.io/aoc2021/hyperfine.html I added GraalVM native-image to my full-execution benchmark. seems to beat kotlin/native in startup time and throughput