5 ms·
I used this technique once to very useful effect in an automated dependency-checking tool. Essentially given an idempotent data-transformation process, you can
by cecilpl2 7y ago
I used this technique once to very useful effect in an automated dependency-checking tool.
Essentially given an idempotent data-transformation process, you can inject a dll into it and hook its filesystem calls, maintaining a list of all files it touches. Upon process termination, serialize out the filesystem state (size, timestamp, MD5) of each of those files, saving the data in a dependency file whose filename is the hash of the command line.
When you run the same command line again, the dll can first look up the dependency file from the previous run, and if all files on the filesystem are in the same state as previously, you can short-circuit the process execution entirely.
This is orders of magnitude faster in many cases for highly-parallel data build jobs where only some small percentage of the source data changes each time you run the build job, and has the advantage that you don't need manually maintain a list of dependencies for each process type (no new dependency can be added without changing one of the existing dependencies).
- new_realist 7y agoOn UNIX this sort of thing is typically done with a virtual file system.
- asveikau 7y agoThat sounds too fancy. If it operates on a given directory, you can write a very simple wrapper shell script to do that with tar.
- pjc50 7y agoIsn't it normally done with the similar technique of LD_PRELOAD, which unlike a vfs can be done from userland?
- vthriller 7y ago> unlike a vfs can be done from userland You can implement and mount such virtual FS entirely in userspace using FUSE.
- sansnomme 7y agoWhat about Ubuntu/Debian's checkinstall?
- beagle3 7y agoAre you describing tup? http://gittup.org/tup/ http://gittup.org/tup/
- cecilpl2 7y agoIt looks similar to that, but no. This was a custom-built tool used internally in a company that is now out of business.