Thanks for the update Thomas; I've converted your notes below into a mirage.io 
blog post so it's easier to reference to users; edits welcome on :
https://github.com/mirage/mirage-www/pull/500

regards,
Anil

> On 17 Nov 2016, at 12:06, Thomas Gazagnaire <[email protected]> wrote:
> 
> Hi all, 
> 
> I am in the process of releasing Irmin 0.12.0[1] which brings support for 
> native file-system watchers, to improve the performance of watches.
> 
> Previously, an Irmin apps who wanted to use watches would set-up file-system 
> scanning/polling by doing:
> 
>    let () = Irmin_unix.install_dir_polling_listener 1.
> 
> which would scan the `.git/refs` directory every second. This was working but 
> it was slow (if you are unlucky you might wait for 1s for the watch callbacks 
> to trigger) and disk/CPU intensive as we were scanning the full directory 
> every second to detect file changes: in case you have 1000s of tags, this 
> could easily saturate your CPU (in case you wonder, yes, we really have Git 
> repositories with 1000s of tags).
> 
> In the 0.12.0 new world, you would do:
> 
>    let () = Irmin_unix.set_listen_dir_hook ()
> 
> and it will do "the right thing". E.g. if you are on linux, and have the 
> `inotify` package installed, it will use libinotify to get notified by the 
> kernel on every change and it will re-scan the whole directory. On OSX, if 
> you have the `osx-fsevents package installed, it will do the same thing using 
> OSX fsevents library. The portable compatibility layer between inotify and 
> fsevents comes with `irmin-watcher`[2] that I have just released as well.
> 
> Best,
> Thomas
> 
> [1]: https://github.com/mirage/irmin/releases/tag/0.12.0
> [2]: https://github.com/samoht/irmin-watcher/releases/tag/0.2.0
> 
> CHANGES:
> 
> Irmin 0.12.0
> 
> * Depends on irmin-watcher 0.2.0 to use portable file-system watches
>  (fsevents on OSX or inotify on Linux) to replace the slow and CPU
>  intensive file-system polling that was the default (#380, @samoht)
> * Do not use `Lwt_unix.fork` in the tests anymore (#383, @samoht)
> * Switch from Stringext to Astring (#382, @samoht)
> * Fix regression in the tests for using Git over HTTP (#376, @samoht)
> * Catch top-level exceptions in watch callbacks (#375, @samoht)
> * Fix merge of assoc list with no common ancestor (#374, @samoht)
> * Improve documentation for Git bare repositories (#363, @kayceesrk)
> * New functor `Make_with_metadata` to customize the type of the
>  nodes metadata (#364, @samoht)
> * Remove mentions of private modules from the public interface
>  (#364, @samoht)
> 
> Irmin-watcher 0.2.0
> 
> - Allow to watch non-existing directories (#8, @samoht)
> - Expose `Irmin_watches.stats` to get stats about the numbers
>  of active watchdogs, and callback dispatchers (#7, @samoht)
> - When using fsevents/inotify do not scan the whole tree everytime
>  (#6, @samoht)
> - Use realpath(3) on Linux and GetFullPathName on Windows to
>  normalise the path to watch (#6, @samoht)
> - inotify: close the inotify file descriptor when stopping the
>  watch (#6. @samoht)
> - inotify: fix the path of watched events (inotify uses relative
>  patch, unless fsevents which uses absolute paths) (#6, @samoht)
> - fix detection of removed files (#6, @samoht)
> 
> 
> 
> _______________________________________________
> MirageOS-devel mailing list
> [email protected]
> https://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel


_______________________________________________
MirageOS-devel mailing list
[email protected]
https://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

Reply via email to