-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPM mode gives unbearable startup time. #5803
Comments
In general, npm-mode is slower to start-up because it bundles (and transpiles for es5) all the frontend stuff. But developer cycles should be practically as fast as in bower-mode. It's something we cannot do so much because we already have webpack-dev-server configuration with the minimum timings. Think that there are many advantages in npm-mode vs bower-mode like:
The solution might be that in npm-dev-mode flow is able to handle requests and return non-bundled modules from the |
I accept that, but in my case there must be something going completeley wrong. for a VERY LONG time of the time it is stalled at
after that everything goes quite fast. |
Are you on Windows? I saw something similar on a Windows machine and could not reproduce it on Mac. |
No I am on linux, launching with IntelliJ |
Apparently https://github.com/johannesh2/textfieldformatter also gives a bad startup time on Windows. |
I suspect #5825 will have an impact on this case, but I haven't tried it out. |
This correlates with my observations. It goes totally crazy in my case :) |
2.0.0.rc3 contains #5825 so now it should be easy to test if there are improvements |
Any idea how I get this into vaadin-spring rc2? |
Looks like https://github.com/johannesh2/textfieldformatter works better with the latest fix in the snapshot even on Mac. |
For me the startup time for the textFieldFormatter stabilised around 13s with rc3 when they for rc2 were closer to 30s. (windows) |
To test you could just add the dependency
|
It's not compatible, so sadly I cannot test it (yet)
|
Right also the spring dependency should be added:
|
The easy way to test would be to wait for 14.0.0.beta3 (tomorrow?) Otherwise do not override individual Flow dependencies, add Flow bom instead
|
I don't get it. now it is starting in bower mode, although package.json and node_modules exist from the maven build. Guess I wait for beta3 |
RIght, you need to use |
Same issue here, with Vaadin 14.0.0.beta3 and a somewhat larger project, I get ~ 2 minutes Jetty startup on the following step: Is there a way to skip this step and jump directly to next step on starting webpack, on subsequent Jetty restarts, as most of the time, I don't touch the layout resources (also, no new JSModule annotations) once the project is setup and working? |
@silvan-lincan or @eiswind we would like to setup a project able to reproduce the same issue with startup times, right now the starters we are using reports a quite acceptable startup. |
Hi @manolo |
I can try to do the same on the coming weekend. |
Hi @manolo , Because of this, if we use these in our project, then, in the following method, all these classes are visited: It is a little bit complicated for me to separate things in the project so that I can make an example. But in the meantime, maybe this will help. Thank you. |
Could you provide a secure upload link? I would be willing to share my project.
…-------- Original-Nachricht --------
An 17. Juni 2019, 15:55, Silvan Eugen Lincan schrieb:
Hi ***@***.***(https://github.com/manolo) ,
I had some time to debug a little bit, to see what is going on, and discovered the following, maybe this helps further:
In com.vaadin.flow.server.frontend.FrontendDependencies#isVisitable I think there are still classes which are not blacklisted in that regexp.
For example, everything which starts with: javax., net.sf, net.bytebuddy, org.joda, org.hibernate, org.glassfish, com.lowagie, com.google, org.hsqldb, com.fasterxml
Because of this, if we use these in our project, then, in the following method, all these classes are visited:
`com.vaadin.flow.server.frontend.FrontendDependencies#visitClass((String,EndPointData), which takes a very long time.
I noticed this during a debug session
It is a little bit complicated for me to separate things in the project so that I can make an example. But in the meantime, maybe this will help.
Thank you.
—
You are receiving this because you were mentioned.
Reply to this email directly, [view it on GitHub](#5803?email_source=notifications&email_token=AAJOIHH5R3CDWS2O6EECXQ3P26JWDA5CNFSM4HQMQVVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX3HVPY#issuecomment-502692543), or [mute the thread](https://github.com/notifications/unsubscribe-auth/AAJOIHHZNSDMW4F57MBQ5I3P26JWDANCNFSM4HQMQVVA).
|
Hi again @manolo , sorry to insist with this, but for me is very important as this has an impact on development time.
and added the patterns that I mentioned in my previous comment.
I have now a steady startup of 40 seconds from a previous 2-4 minutes. Is there a chance that this is taken in consideration and rolled-out? Thank you. |
Hi @eiswind . No need for this as for me the issue is kind of clear. Please see my new recent comment. |
@silvan-lincan thank you for your time and effort, really appreciate it. I agree with you on both accounts, we need to include more common packages to the regex but it is also a good idea to make it possible for the project to blacklist more packages. Mayhaps also to whitelist. However, the improved 40 seconds startup is also quite much, so I would like to know
|
Hi @pleku With Vaadin 13.x: With Vaadin 14.0.0.beta3:
I hope this helps further and I thank you again for replying, this means a lot. |
Whitelisting or blacklisting will always be problematic. What if we e.g. blacklist This in turn means that we should put effort into making the defaults perform better so that special overrides are only needed in special cases. One potentially impactful approach there would be to more aggressively cache the scanning results. For caching to work in this case, the cache would have to be persisted in the developer's file system so that it's available between runs. An easy but slightly limited approach would be to put the cache somewhere in the project's Another question is exactly what is cached. My gut feeling is that it would get us quite far to simply cache which .jar files are known to not contain anything of interest for our purposes. The cache could identify the files either based on (name + size + timestamp) or based on a hash of the file contents. Using a hash of file contents would also make it safe and easy to include a precomputed hash based on known transitive dependencies so that those would not have to be recomputed by every user. |
Hi, @silvan-lincan, I have been able to reproduce the scan time performance problem in one of our integration tests, probably not exactly the same dependency tree than yours, but still significant to isolate the problem and able to reduce scan time. I could measure an improvement of the start time from |
Hi @manolo, thank you very much. That is really great news. |
@silvan-lincan can you checkout the branch in PR #5932, and do measurements with your project ? |
Hi @manolo Thank you. |
It might break, although in the projects I tested the patch I didn't found any problem. You would need to check whether the |
Hi @manolo |
Thanks for the feedback, there are many numbers in the thread, what is the exact improvement in ms applying the patch? |
While this won't be in Flow 2.0.0, we are going to make 2.0.1 soon hopefully with the improvements included, we just want to take time to thoroughly test it. And then it will end up into a Vaadin 14 release soon. |
Hi @manolo Total start time: From which the time spent on scanning: 2923ms
Time spent on webpack: 4000ms Hope this helps. |
Hi @pleku |
... so with the patch, I kind of obtain the same startup speed as with Vaadin 13.x, which is super Ok. |
Just to clarify 2.0.0 already includes #5933 which includes the regular expression for blacklist you sent, that should cover partially your problems. For the other we need more rework and tests. |
Great, thank you. |
I converted my app to npm mode and ran mvn package to install all the deps.
So its already
When I launch the app from IntelliJ startup time increased from about 10 secs to
This is not a big app, it's around 70 kotlin classes.
The text was updated successfully, but these errors were encountered: