TWIMC: I’m hacking together a Gradle plugin with m...
# advent-of-code
o
TWIMC: I’m hacking together a Gradle plugin with multiplatform benchmarks (JMH on the JVM, benchmark.js in node, something not yet decided in Native, if possible). Decided to test-drive it in smaller audience here (compared to #multiplatform). If you’re interested, send me your mpp project link to play with in the thread
j
Oooh, count me in! My aoc project is https://github.com/jorispz/aoc-2018 I didn't do much custom configuration, basically created a mpp project in IDEA, and fiddled a bit to create a native executable instead of a lib. I use a pretty crude expect/actual implementation of measureNanoTime, would be very interested in a better way
o
Thanks! Cloned, testing. One bug found, though not mine: JMH doesn’t work with empty package…
Humm, @Joris PZ, there are
println
for answer output, how do you benchmark it with console output?
j
Well, like I said, this is all very crude, I am simply timing how long my daily solution takes to run, from parsing to outputting (intermediate) results and everything in between. I am running these tests out of general interest, like it says in the README I am not claiming accuracy...
o
Yeah, right, sorry. I still thought you would be running several times 🙂 But no problem, fixed it here with a hack. Got something running!
Copy code
> Task :jsBenchmark
Running benchmarks…
Benchmarks.b01 x 19.52 ops/sec ±6.79% (36 runs sampled)
Benchmarks.b02 x 8.37 ops/sec ±1.09% (25 runs sampled)
Benchmarks.b03 x 0.92 ops/sec ±2.43% (7 runs sampled)
Benchmarks.b04 x 62.90 ops/sec ±0.66% (65 runs sampled)
Complete!
j
Cool! And I am running several times, there's a runner that takes two command line arguments, the number of repeats and the number of the puzzle, so each day after I solved the day I run the main function of Runner on each platform, doing 25 repeats per platform. The results of that are in the readme