apache / cordova-fetch

Apache Cordova Fetch Library
https://cordova.apache.org/
Apache License 2.0
27 stars 27 forks source link

cordova-fetch is much slower at prepare #52

Closed ekrapfl closed 6 years ago

ekrapfl commented 6 years ago

It would appear that when I run a cordova prepare using cordova-fetch, it takes drastically longer than when I run it without cordova-fetch.

I have tested this on a repo with no platforms or plugins present in the directory structure, and about 20 plugins and 2 platforms defined in the package.json.

Using cordova 6.5, cordova prepare runs in about 30 seconds to add the platforms and plugins. Using cordova 7, cordova prepare --nofetch takes about the same amount of time. Using cordova 7, cordova prepare takes about somewhere around 5 minutes. Using cordova 8, cordova prepare takes about the same amount of time as cordova 7 with the fetch.

Is this a known issue? This is a pretty painful amount of time to have to wait for a clean build. It causes builds on our build server to bloat quite significantly.

Any help would be appreciated. Thanks!

dpogue commented 6 years ago

This is a known issue. The good news is that it will be fixed in Cordova 9, the bad news is that Cordova 9 isn't ready to be released yet.

ekrapfl commented 6 years ago

Dumb question. Is there any sort of time frame for Cordova 9 at this point?

dpogue commented 6 years ago

I don't want to make any sort of official sounding statement that could be interpreted as committing to a date :sweat_smile: I know all of us working on it would like to see it released before the end of the year.

ekrapfl commented 6 years ago

I won't hold you to the fire 😀. We all cringe when asked for a "release date".

galsc-tr commented 5 years ago

@dpogue, is there any updates on this issue?

phyr0s commented 5 years ago

In my app more than 30 minutes to donwload all the plugins, this is a big trouble

rricamar commented 5 years ago

@videmort totally agree, do some builds in a CI environment is so painful 🔥

manudefrutosvila commented 5 years ago

@videmort you so true, i can take a nap while reinstalling the cordova plugins

phyr0s commented 5 years ago

@manudefrutosvila you can take 2-3 nap per day. The proof @dpogue (Run on mac PRO top specs)

captura de pantalla 2019-01-16 a las 15 12 37
dpogue commented 5 years ago

Yes, we are aware. This affects all of my CI builds too.

The issue has been fixed and released as cordova-fetch 2.0.0. We're in the process of doing a major version release for all the platforms and tooling which will pull in this updated version.

galsc-tr commented 5 years ago

@dpogue, is there an ETA when the new version will be released?

galsc-tr commented 5 years ago

Hi,

Seems like new major Cordova-Android and Cordova-iOS were released (https://cordova.apache.org/announcements/2019/02/16/cordova-android-release-8.0.0.html, https://cordova.apache.org/announcements/2019/02/09/cordova-ios-release-5.0.0.html)

Is the problem resolved ?

janpio commented 5 years ago

afaik those are only the platforms fetched by cordova-fetch. you'll have to wait a bit longer until codova cli 9 is released.

galsc-tr commented 5 years ago

@janpio any eta when cli 9 will be released?

janpio commented 5 years ago

As soon as it's ready. The Android and iOS releases where some of the last "big" releases, so we are definitely talking more weeks than months.

phyr0s commented 5 years ago

Any news?

janpio commented 5 years ago

https://github.com/apache/cordova/issues/10#issuecomment-470779785

ekrapfl commented 5 years ago

Very close now: https://github.com/apache/cordova/issues/10#issuecomment-476054219 Just waiting on the plugins to be updated at this point.

dpogue commented 5 years ago

This has been released as part of Cordova 9. Please try installing cordova@9.0.0 from npm.

ekrapfl commented 5 years ago

The prepare is wicked fast with cordova@9.0.0, but I am unable to take advantage at the moment because we require a plugin to be updated as well. Looking great, though!

bytenik commented 5 years ago

Prepare is no faster for me on 9.0.0 than on 8.x. Is there something additional I need to do to see the increased speed?

ekrapfl commented 5 years ago

That is odd. Just updating to cordova@9.0.0 took our prepare from 10-15 minutes down to 10-15 seconds. Dumb question, did you make sure you updated the globally installed cordova if you have one (or locally installed, if that is what you use)?

bytenik commented 5 years ago

I did not install globally, but, I did execute npx cordova prepare android. npx should cause it to use the local copy.

I wouldn't expect 10-15 seconds as I am doing a full restore prepare (incl. fetch) -- I started with no platforms or plugins directories. But, it also shouldn't take 3-5 mins per plugin.

ekrapfl commented 5 years ago

Yeah, when switching over to cordova@9.0.0, I am literally seeing 10-15 seconds for the full prepare. Nuking platforms and plugins, the only thing I have done is an npm install. I'm not sure why you are not seeing that improvement.

dpogue commented 5 years ago

If you did not run npm install, cordova-fetch still has to install plugins one at a time. If you ran npm install and already have a node_modules folder, cordova-fetch will check that the installed version meets the criteria and then use it.

Plugins being installed from git URLs need to be fetched every time, because npm doesn't give us a good way to verify that it's the correct commit.

hoshauch commented 5 years ago

It's really fast now, thx!