Sitecore / docker-tools

Sitecore Docker Tools are utilities which assist Sitecore developers in initializing and running containerized Sitecore environments.
MIT License
27 stars 17 forks source link

Investigate using watchexec as possible replacement for Watch-Directory tight loop running ROBOCOPY #9

Open pbering opened 3 years ago

pbering commented 3 years ago

Local tests of https://github.com/watchexec/watchexec shows promising results as a possible replacement of https://github.com/Sitecore/docker-tools/blob/main/image/src/scripts/Watch-Directory.ps1#L185. The current loop uses 2-3% CPU when idle where watchexec uses 0.

Other observations while testing watchexec:

  1. It uses less that 1 MB of memory.
  2. Watching an average Sitecore web application project / deploy folder it seems very good to batch events so it does not trigger too many times.
  3. Default ignoring glob patters defined in .gitignore and supports excluding/including files/folder from parameters.

We need to test this in a container to:

  1. See if it work at all since it is based on file events from the OS which can work behave differently in a container.
  2. Measure idle CPU usage / memory to see if there is actual benefits by switching.