You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to the fact, that commands can receive arguments, there is a high chance that their results depend on it. Because of this, Mill currently does not cache commands, but re-evaluates them every time. This is a rather pessimistic approach. Can we do better?
What if we could give commands a change to reuse there previous results and decide themself whether they need to re-do their work or not. Although Mill does not reuse cached command results, it persists the cached results of evaluated commands. So, technically, it should be easy to pass the previous evaluated result to the current command execution. Additional, it might be possible, to let commands also persist their previous T.dest, in a same way as T.persistent targets do, And access to the previous command arguments is also needed. With this three ingredients, a command could decide to reuse parts of the previous execution.
Why do we want something like this? My best example is the test We don't have a way to figure out, how to run only those tests that have changed since the last test run. With the changes described above, we could implement a more efficient test command, that only runs changed tests or tests affected by changes since the last run. There is also testCached, which could be implemented as T.persistent to do this, but then there is no chance to pass additional parameters.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Due to the fact, that commands can receive arguments, there is a high chance that their results depend on it. Because of this, Mill currently does not cache commands, but re-evaluates them every time. This is a rather pessimistic approach. Can we do better?
What if we could give commands a change to reuse there previous results and decide themself whether they need to re-do their work or not. Although Mill does not reuse cached command results, it persists the cached results of evaluated commands. So, technically, it should be easy to pass the previous evaluated result to the current command execution. Additional, it might be possible, to let commands also persist their previous
T.dest
, in a same way asT.persistent
targets do, And access to the previous command arguments is also needed. With this three ingredients, a command could decide to reuse parts of the previous execution.Why do we want something like this? My best example is the
test
We don't have a way to figure out, how to run only those tests that have changed since the last test run. With the changes described above, we could implement a more efficient test command, that only runs changed tests or tests affected by changes since the last run. There is alsotestCached
, which could be implemented asT.persistent
to do this, but then there is no chance to pass additional parameters.Beta Was this translation helpful? Give feedback.
All reactions