Watchman: Faster builds with large source trees
facebook.com
Watchman: Faster builds with large source trees
1–10 of 22 posts
Re: Watchman: Faster builds with large source trees
#2Re: Watchman: Faster builds with large source trees
#3Re: Watchman: Faster builds with large source trees
#4Not sure how this is different from inotify+md5+make?
Re: Watchman: Faster builds with large source trees
#5Not sure how this is different from inotify+md5+make?
Re: Watchman: Faster builds with large source trees
#6Not sure how this is different from inotify+md5+make?
Not sure how inotify is different from while+stat?
My point was that the additional functionality of this significantly-sized package beyond running inotify+md5+make in a shell script was unclear.
Re: Watchman: Faster builds with large source trees
#7Compiling while editing. Intredasting.... I assume there is some crazy dependency algorithm.
Re: Watchman: Faster builds with large source trees
#8Re: Watchman: Faster builds with large source trees
#9Incremental 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 in its build (see the "node stat" lines here: https://github.com/martine/ninja/wiki/Timing-Numbers ). At its best point I think we got the one-file-changed build/compile/link cycle of Chrome (a ~70mb C++ binary) to around 5 seconds.
Of course, Facebook's problem is surely very different -- their scale could be many more files, and perhaps the programs their engineers run while developing cause their disk caches to flush more frequently. Just found it interesting to worry about the cost of stats.
Re: Watchman: Faster builds with large source trees
#10Not sure how this is different from inotify+md5+make?
Not sure how inotify is different from while+stat?
while inotifywait -e attrib,modify /etc/httpd/conf/httpd.conf -e attrib,modify,create,delete,move -r /etc/httpd/sites-enabled ; do
/sbin/service httpd graceful && echo "`date -u --rfc-3339=seconds` httpd graceful" >> /etc/httpd/conf/httpd-conf.log
done
Shows how to monitor a single file and a directory, and do a sequence of commands if events happen. Unlike while stat, this doesn't spam checking the file system for changes, it waits until the kernel notifies that a change happened.To "daemonize" this, tack on an invocation test, perhaps:
#!/bin/bash
if [ "x$1" != "x--" ]; then
$0 -- 1> /etc/httpd/conf/watchconf.log 2> /etc/httpd/conf/watchconf-err.log &
exit 0
fi
while inotifywait -e attrib,modify /etc/httpd/conf/httpd.conf -e attrib,modify,create,delete,move -r /etc/httpd/sites-enabled ; do
/sbin/service httpd graceful && echo "`date -u --rfc-3339=seconds` httpd graceful" >> /etc/httpd/conf/httpd-conf.log
done