Day 4: The Ideal Stocking Stuffer

Puzzle Description

Advent of Code 2015, Day 4

Full Solution Source

My Solution for 2015, Day 4

For most languages (and plain Scala, if you aren't cross compiling) today isn't really that interesting. However, it's very interesting if you are doing this for Scala.JS or Scala Native.

My Scala Native version links to openssl libcrypto. JVM uses java.security.MessageDigest, and JS rolls its own MD5 hash function.

Benchmark

Part 1

Mean

Error

JVM

72.944 ms

+/- 1.120 ms

JS

1094.642 ms

+/- 7.855 ms

Native

329.518 ms

+/- 1.415 ms

Part 2

Mean

Error

JVM

2.078 s

+/- 0.208 s

JS

31.959 s

+/- 7.690 s

Native

9.361 s

+/- 1.551 s

Run it in the browser!