adventofcode-2018
adventofcode-2018 copied to clipboard
Run as fast as possible
Description
Stop running super-mega-long solutions.
Design
Add a boolean flag --fast
or --no-slow
to the run
command
Timeout
Discard solutions that take more than 5s to run.
We could also add a integer flag --timeout
to override the default 5s timeout.
Slow flag
Add a file to list all slow solutions (blacklist) ~or all fast solutions (whitelist)~ and use this file to deduce solutions to be run.
All together
A naive approach for the timeout feature would be running the solution and force stop the execution after 5s. If a solution timeouts on the first input, it will likely timeout on all other inputs. Which means for each input, we run spend 5s for nothing.
This is improvable by flagging the solution as slow on the first input and avoid running it on other inputs. In a sense, this is a dynamic version of slow flag with a discrimination based on timeout.