GithubHelp home page GithubHelp logo

Comments (10)

micha avatar micha commented on May 14, 2024

Unless I'm mistaken this sensitivity parameter is only relevant when the watch service falls back to polling mode, which should not be the case when barbarywatchservice is in place. Moving from FSEvent handler to polling would put more load on the CPU, which we'd like to avoid if possible.

Do you see this behavior always? Can you please make this simple test:

$ mkdir src
$ boot -s src watch -v show -e

then, in another terminal do

$ touch src/foo
$ touch src/foo

Does it still take a couple of seconds to see the watcher update?

from boot.

jeluard avatar jeluard commented on May 14, 2024

Unless I'm mistaken this sensitivity parameter is only relevant when the watch service falls back to polling mode, which should not be the case when barbarywatchservice is in place.

You might be right. I was referring to completely removing barbarywatchservice as when using the sensitivity parameter performance is good enough even if it is relying on polling.
I also noticed barbarywatchservice creates one thread per watched folder (including boot temp ones) which might be an issue if you have a large number of folders? Also this library seems abandoned.

I didn't have any significant latency doing your test so there must be something else going on. I will investigate further.
Thanks!

from boot.

micha avatar micha commented on May 14, 2024

How does the CPU utilization when you increase the sensitivity to the maximum and fall back to polling mode compare to the barbarysoftware fsevent implementation? With boot1 polling used too much CPU, but we didn't have access to the watchservice (this was java 1.6).

from boot.

jeluard avatar jeluard commented on May 14, 2024

I've been using this in a custom build on a significant project (a dozen folder, a hundred clj/cljs/cljx files) for the last couple months and CPU usage has never been an issue. I always have sub-second cljs recompilation for instance.
I didn't try with boot but I don't see how it could be different.

from boot.

jeluard avatar jeluard commented on May 14, 2024

I did some more experimentation on this and finally thinks this would be worth removing barbaryservice. You can find relevant changes in my fork.

I believe it is worth because:

  • changes are picked up faster on my system and overall boot feels faster
  • it removes all those useless threads
  • no more dependency on a frozen project
  • ClojureScript rely on the same logic

I did some tests on a project with more than 100 source files and performance are pretty good and CPU usage quite low.

Would you consider a PR?

from boot.

micha avatar micha commented on May 14, 2024

I can't find anyone else on OSX who experiences the delay you're reporting, so I'm hesitant to make this change. Is it possible that there is something about your system that's causing the issue?

from boot.

jeluard avatar jeluard commented on May 14, 2024

I understand your reluctancy given the potential impact it has. Still I think this patch would makes sense even without perf improvement as current implementation can be considered a workaround.

As a first step some configuration could be introduced to easily switch to the native implementation while still defaulting to the current one.

What do you think?

from boot.

micha avatar micha commented on May 14, 2024

I think I like it :)

We should be able to add a flag somewhere, (maybe a system property?) and just fall through to the Java watch service if the flag is set. If we can do this without disturbing the existing logic then I think we should, but if we need to make changes to the logic then I'd be more skeptical, because what we have there currently is the product of a lot of hard-won workarounds for different weird bugs.

from boot.

jeluard avatar jeluard commented on May 14, 2024

Great! I'll let you know how that works but it will probably take me some time.

from boot.

jeluard avatar jeluard commented on May 14, 2024

I now switched to a linux machine and don't have this issue anymore. I will close this issue for now as it seems no other OSX user were experiencing this.

from boot.

Related Issues (20)

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.