My 1ms solution (plus a dumb and slightly less dum...
# advent-of-code
b
IntArrays for sure are fast
1ms for the hyperoptimized, 13ms for the intermediary 35ms for the dumb version
oh I can even go below that… now I need to use nanos…
first run is 0.8ms
making it sorted also makes it much faster… down to 0.3 (but loading time of course is slower)
e
modified your code to run part 1 and 2 separately, threw it into my jmh benchmark, this was the result:
b
Cool!
e
I'd suggest setting up JMH, or at least make a test harness that can repeatedly run your functions
b
yep I need to try that
what's your machine like?
e
Linux, i7-8809G
b
ok seem coherent with what I see then
thanks, jmh is setup now
seems to be working well
running case 1 and 2 together: 3ms/op for dumb, 1.6ms/op for intermediary 0.039ms/op for crazyOpt
taking the worst case, the crazyOpt is ~38 times faster… that's decent 😄
Thanks for your config, there are quite a few things in there I'll steal from you