pash
pash copied to clipboard
Avoiding compilation overhead in fragments where compilation is doomed to fail
It would be great if PaSh could determine (using profiling) that a fragment that failed can never succeed in a different loop iteration, for example if the fragment:
- uses a non-pure command, then there is no way it will succeed in a later iteration
- does not depend on a file (e.g., just
echo) and takes a small time/cannot be parallelized even if pure - ...
Adding new conditions should be pretty simple, the main complexity is designing the mechanism that avoids going to PaSh mode.
Then it could set an environment variable to completely avoid going to pash mode when in that fragment. This could reduce PaSh's overhead significantly, especially in loops that are the biggest source of PaSh overhead at the moment.