Watchman: Faster builds with large source trees
11–20 of 22 posts
Re: Watchman: Faster builds with large source trees
#12I considered guard (https://github.com/guard/guard) and Nodemon (https://github.com/remy/nodemon), but Watchman has less dependencies (doesn't require Ruby/Node).
There's also Supervisor (Python) (http://supervisord.org/), but I think that is more process management. I'm not sure if it can do file-watching as simply as Watchman.
Re: Watchman: Faster builds with large source trees
#13Re: Watchman: Faster builds with large source trees
#14Not sure how this is different from inotify+md5+make?
For the Facebook www build it is no longer practical to hash every file to see if it changed because there are so many that it is pretty common for the files to have fallen out of the buffer cache. Attempting to hash the files can thus lead to a significant amount of I/O and translates directly to an increased wait time for the user.
In addition, because of the volume of files, it is not feasible for us to statically declare the build dependencies using a traditional Makefile or similar tool; it is crazy to maintain manually and generating the mapping is itself an expensive operation.
We chose to implement this in C because because it gave us tight and deliberate control of the resources and dependencies of the service.
Re: Watchman: Faster builds with large source trees
#15Not sure how this is different from inotify+md5+make?
Watchman uses inotify under the covers (or kqueue or portfs, depending on the OS) and abstracts the differences away. For the Facebook www build it is no longer practical to hash every file to see if it changed because there are so many that it is pretty common for the files to have fallen out of the buffer cache. Attempting to hash the files can thus lead to a significant amount of I/O and translates directly to an…
Re: Watchman: Faster builds with large source trees
#16Earlier quoted context omitted.
Watchman uses inotify under the covers (or kqueue or portfs, depending on the OS) and abstracts the differences away. For the Facebook www build it is no longer practical to hash every file to see if it changed because there are so many that it is pretty common for the files to have fallen out of the buffer cache. Attempting to hash the files can thus lead to a significant amount of I/O and translates directly to an…
I often think it would be useful for a filesystem to provide a digest of a file's content. It's the FS that knows when the file's content changes and the digest is out of date, and it also only needs to recalculate if anything asks. It wouldn't necessarily have to read all the bytes of the file to re-calculate; it may be a hierarchical digest where much of the existing, stored, labour can be re-used.
Re: Watchman: Faster builds with large source trees
#17Not sure how this is different from inotify+md5+make?
This is cross-platform, which inotify isn't. Also, isn't inotify pretty low-level? It looks like FB has consolidated common inotify helper code into a reusable daemon.
Re: Watchman: Faster builds with large source trees
#18I read their problem statement, describing the features they needed. Seemed like Git could solve their problems, with a few well written hooks.
Re: Watchman: Faster builds with large source trees
#19If I'm reading that graph right, the red line is at 10kmsec, i.e. 10 seconds? Incremental build times are near and dear to my heart; I spent a lot of time making the Chrome incremental build fast, resulting in this tool: http://martine.github.io/ninja/ . In developing Ninja I was surprised to discover that Linux stat() with a warm disk cache is very fast -- well under 100ms to stat the ~40k source files Chrome uses i…