lein-figwheel
lein-figwheel copied to clipboard
10-30 second lag between file changes and figwheel recognizing file changes
I'm working on a large project, and over the past few months figwheel has gradually been getting slower and slower. It's now pretty much unworkable.
Are there any common pitfalls that might cause Figwheel not to be notified of file changes?
We're currently using clojurescript 1.9.854
Can you give a bit more detail on your environment (editor, OS, Figwheel version, Lein version, Java version, etc) and how you measured the time difference between changes and Figwheel detecting them? For example IntelliJ’s automatic saving can be configured to delay n seconds after activity. Also, roughly how many source files do you have?
I'm using Emacs on Mac OSX, my cofounder has comparable lag using Emacs on Linux.
It's about 10-30 seconds between when I save my file and when I get the console.log notification that says "Figwheel notified of file changes"
We've got about 105 files in our main app, and about 90 files in devcards.
On Sat, Mar 10, 2018 at 4:56 PM, Daniel Compton [email protected] wrote:
Can you give a bit more detail on your environment (editor, OS, etc) and how you measured the time difference between changes and Figwheel detecting them. For example IntelliJ’s automatic saving can be configured to delay n seconds after activity. Also, roughly how many source files do you have?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bhauman/lein-figwheel/issues/666#issuecomment-372080168, or mute the thread https://github.com/notifications/unsubscribe-auth/ACljr3E-6NJxLjSpq0k_AmJr0CUlnzHoks5tdHZHgaJpZM4Slgco .
-- Conor White-Sullivan 470-263-4088 @Conaw http://twitter.com/conaw
Good tests kill flawed theories, we remain alive to guess again. ~ Karl Popper
Latest version of Figwheel too? There were some improvements to topological sorting a few releases ago.
What version of Figwheel are you using? (You should be using 0.5.14 at least. Do this first. Remember to clean thoroughly when upgrading.)
Are you using :recompile-dependents false
in your compiler options? (This speeds the clojurescript compiler up.)
How long do incremental compiles take if you use cljsbuild auto? (This gives us a baseline)
My best guess is that, like Daniel said, you are using a Figwheel version lower than 0.5.1.4.
We've been on the 0.5.14 for a while, and it hasn't helped. Neither did setting recompile-dependants to false.
Intermittent compilation using cljsbuild takes between 16.023 and 19.256 seconds
On Sun, Mar 11, 2018 at 5:48 AM, Bruce Hauman [email protected] wrote:
What version of Figwheel are you using? (You should be using 0.5.14 at least. Do this first. Remember to clean thoroughly when upgrading.)
Are you using :recompile-dependents false in your compiler options? (This speeds the clojurescript compiler up.)
How long do incremental compiles take if you use cljsbuild auto? (This gives us a baseline)
My best guess is that, like Daniel said, you are using a Figwheel version lower than 0.5.1.4.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bhauman/lein-figwheel/issues/666#issuecomment-372112926, or mute the thread https://github.com/notifications/unsubscribe-auth/ACljr0P-dKK5SsiUk8ZctvbNcxjx8Aahks5tdR0lgaJpZM4Slgco .
-- Conor White-Sullivan 470-263-4088 @Conaw http://twitter.com/conaw
Good tests kill flawed theories, we remain alive to guess again. ~ Karl Popper
I'm happy to help work out what is going on here.
I need to verify that your "incremental" cljsbuilds are 16 and 19 seconds? Incremental meaning how long it takes for a cljsbuild "auto build" that's responding to a change in your filesystem after the first build has completed, this should not take 16 to 19 seconds as it should only be compiling one file if :recompile-dependents
cljs compiler option is set to false.
Yes, it takes much longer than 16 seconds for the initial build, each subsequent change takes 16 seconds or more, occasionally it'll be as high as 120 seconds. This is on cljsbuild auto with optimizations none
On Mar 13, 2018 5:32 AM, "Bruce Hauman" [email protected] wrote:
I'm happy to help work out what is going on here.
I need to verify that your "incemental" cljsbuilds are 16 and 19 seconds? Incremental meaning how long it takes for a cljsbuild "auto build" that's listening to your filesystem after the first build has completed, this should not take 16 to 19 seconds as it should only be compiling one file.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bhauman/lein-figwheel/issues/666#issuecomment-372649365, or mute the thread https://github.com/notifications/unsubscribe-auth/ACljr3GXgORfGVzWKlSnTYvxPCtED1Hrks5td7xVgaJpZM4Slgco .
So this isn't figwheel but rather what it is you are compiling.
:recompile-dependents false
should mean that when you change one file, then only one file gets compiled. Can you verify this with cljsbuild somehow?
If one file is taking 16 seconds to build. Then there is some insane macro compilation going on, perhaps some heavy use of core.async or maybe there is a circular dependency and the compiler is looping.
Or .... your output source files are on your classpath such that they are being mistaken for input files. This could happen if your output files are being output to a resource root path. I doubt this is the case.
This is on cljsbuild auto with optimizations none
Are you seeing this with cljsbuild as well as Figwheel?
I'm seeing the same speed with both figwheel and cljsbuild so the problem doesn't seem to be with figwheel. Thanks for helping me narrow that down.
I can not confirm that only one file is being compiled, here's my project.clj though https://gist.github.com/Conaws/5837aba08e0e2761a41768d257e11ef7
I do have a macro which makes use of a multi-method defined in a cljs file. I'm starting to think this might be the source of the problem.
On Tue, Mar 13, 2018 at 12:59 PM, Daniel Compton [email protected] wrote:
This is on cljsbuild auto with optimizations none
Are you seeing this with cljsbuild as well as Figwheel?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bhauman/lein-figwheel/issues/666#issuecomment-372798709, or mute the thread https://github.com/notifications/unsubscribe-auth/ACljr39i7kehD1XYPNFK6FHJ7eyrXw0lks5teCU1gaJpZM4Slgco .
-- Conor White-Sullivan 470-263-4088 @Conaw http://twitter.com/conaw
Good tests kill flawed theories, we remain alive to guess again. ~ Karl Popper
Turns out the problem was with npm-deps, same as here https://dev.clojure.org/jira/browse/CLJS-2339