Closed gregorriegler closed 2 years ago
Can I ask you to provide a minimal reproduction for Gradle and Task so that benchmarks can be made and used for comparison?
watch-slow.zip So i made this zip. In the left corner we have Taskfile
version: '3'
tasks:
test:
cmds:
- echo Taskfile
sources:
- test.txt
fighting against the oldschooler in the right corner: Makefile with inotifywait
.PHONY: test
test:
echo "Makefile";
.PHONY: watch
watch:
while true; do \
make test; \
inotifywait -qr -e modify -e create -e delete -e move test.txt; \
done
run both, and change test.txt to trigger the task.
Looks like the watch command polls every 5 seconds? https://github.com/go-task/task/blob/master/watch.go#L19 The library being used to poll file system events does not use inotify (as that's not available on all OSs)...
Hi everybody,
I believe that having an attribute on the Taskfile (and possible a flag, too) to have a different polling interval would do the trick here.
We could also consider switching to a library that uses the OS notification API, but I wanted to avoid it initially because it may behave differently based on the user's OS.
I use watchexec and just right now. So I'm not waiting for this. But I think it could be beneficial for you to have it built in. Easier setup and scripting for users.
We could also consider switching to a library that uses the OS notification API, but I wanted to avoid it initially because it may behave differently based on the user's OS.
Do you say 'may' because we're not sure? In that case I recommend trying For the thing I'm doing I'm not sure if an interval would be sufficient. But maybe it's worth trying, too
I'd like to give it a try.
This was implemented by @ilewin at #865.
I plan to make a new release still today.
I have
gradle -t test
(this is watching for file-changes and then reruns the tests) andtask test --watch
open at the same time and task is significantly slower. It reacts to filechanges about a second later, while gradles watcher is instant. Do you see an easy way to make it faster?