adventofcode-2018 icon indicating copy to clipboard operation
adventofcode-2018 copied to clipboard

Run as fast as possible

Open badouralix opened this issue 5 years ago • 0 comments

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.

badouralix avatar Dec 09 '18 23:12 badouralix