Git Product home page Git Product logo

hottie's People

Contributors

scf37 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hottie's Issues

Hottie file watching performance could be better (especially on osx)

From what I can tell, Hottie uses filewatch to watch files. Unfortunately, the default jdk watchservice on osx is a slow polling service. I wrote a cross platform file tree cache library that is somewhat similar to filewatch: swoval-files. Funnily enough, I started out writing a plugin that overrides the default sbt watch implementation ala
sbt-overwatch (sbt-closewatch). At any rate, the swoval-files library is now used by sbt to implement ~. If you were to switch to using that library instead of filewatch, you'd get good osx performance for free (it also has been extensively tested on linux, windows and freebsd).

The PathWatcher interface is very similar to the watch interface that you provide in filewatch. If you are willing to use more memory, you can use the FileTreeRepository interface which caches portions of the file system in memory. Each cache entry has an associated value that is computed more or less by invoking a function from Path => T for some type T. The FileTreeRepository interface allows you to add an arbitrary number of observers that will receive callbacks whenever a file under monitor changes. Because we cache the value, there is an update callback that provides both the current and previous value of the cache value. You can use this to avoid triggering a re-compile if a source file is touched but not actually modified. I provide an example of this in the readme that uses the last modified time as the cache value, but it could just as easily by, say, the md5sum of each file.

Also, sbt 1.3 is very likely to introduce a new task called watch that has the same semantics as ~. This new task will be highly configurable wrt what files it monitors and how it reacts to user input and file events. Hottie seems like it would be a great sbt plugin. I will be writing up full documentation of this new sbt functionality soon.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.