Noticed very high CPU usage using poll vs watchman. Looking at the code, it appears to create a new watcher every time watch is called, so this modifies the jurigged usage to only call watch once and then updates the registry used by the watcher.
The latest code update aligned the usage of watch so that polling was, by default, used for all files. Previously it was mixing poll and using the default of watchman. Tests and conftest files are automatically watched, so the use of watchman was hiding this inefficiency. Switching them to poll brought this out.
Noticed very high CPU usage using poll vs watchman. Looking at the code, it appears to create a new watcher every time
watch
is called, so this modifies the jurigged usage to only callwatch
once and then updates the registry used by the watcher.The latest code update aligned the usage of
watch
so that polling was, by default, used for all files. Previously it was mixing poll and using the default of watchman. Tests and conftest files are automatically watched, so the use of watchman was hiding this inefficiency. Switching them to poll brought this out.