-
Notifications
You must be signed in to change notification settings - Fork 467
size of chcp.manifest file #89
Comments
Thanks for benchmarking, quite an interesting numbers.
Yes, there is always something that can be optimised and improved. Never sad, that it is perfect :) Right now I've been focused on making plugin more stable, postponing new features and performance improvements. One of the suggestions from the people is using gzip: #69 . It should increase the speed of the download process. Regarding minify: Regarding using archives:
That's strange, because it should have calculate checksum only for the updated files. If you changed only one file - it should have calculated it only once for that particular file.
Maybe moving 5000 files for one time? :) |
So you mean the checksum is not re-calculated on smartphone side, the plugin just compare the 2 manifest files ? The fact is that there is something with the 5000 files I agree with the approch of the manifest file that remove the dependency :) |
On the update fetching step plugin loads manifest from the server and compares it with the manifest of his current working directory. It searches for new/changed files and then loads them from the server. When each file is loaded from the server - plugin checks his md5 hash to make sure, that it is not corrupted. On the installation step plugin once more checks loaded files by calculating their checksum. Just in case. So yes, it is calculated only 2 times for each changed/new file: then file is loaded from the server and just before the installation. So, if you changed 1 file - it should have been executed only two times.
At the end of this part of the docs you can find a bit more details about how updates are prepared and installed. In short, for each new release new folder is created. In it plugin places loaded files from the server, plus all unchanged files from the current working release on users device. This is why it copies 5000 files for the new release. Before v1.2 there was another approach: there was only one directory for each release (with some tweaks). As a result, plugin didn't have to copy all the files for each update. But this led to some critical issues:
So, moving to "new release - new folder" scheme add's some additional time on the installation process, but makes it safer for the user and developer. |
Fully understand, that make sense, thx |
I'm kind of on the same path. I'm at a point where I keep getting error code -4 due to timing out. Where can this setting be updated? |
@dwhitmore can you provide more details about it? |
Description is ''the request timed out'. I've verified the files are in the correct location. It happened when I loaded some videos in an update for offline viewing. I was assuming the download was too large. |
@dwhitmore strange, will check it out. Didn't test it on large files, since didn't plan to use it like so. As wrote before, If you need to load some large files from the server, that user want to see - you should, probably, not add it in the app itself, but download when application starts, providing some loading progress to the user. |
These files need to be installed with the app with occasional updates as On Thu, Jan 14, 2016 at 10:59 AM, Nikolay Demyankov <
|
Ipad shows 4GB remaining in memory. App is around 500MB. Updates around 200MB mostly work, 300MB updates reliably crash: Console shows: malloc: *** mach_vm_map(size=147456) failed (error code=3) This is during the fetch, before the download. How exactly does the process work, I'm assuming every update creates a new container, fetches new files there and then copies over unchanged files. When is the old container removed? Or does it not get removed? Thanks for all your help. |
Not exactly. It is described in this part of documentation, starting from:
Also, some info can be found in the messages above. On the fetch step plugin creates a cache folder on file system and downloads in it new content. On the install step plugin creates a copy of the existing So, if your |
Looking at the logs, it looks to be a memory error when downloading. Are Thanks again. On Fri, Jan 15, 2016 at 10:42 AM, Nikolay Demyankov <
|
For download on iOS plugin uses NSURLSession. Basically, with default configuration. So, I think it just loads data into device RAM, and then calls a completion block with loaded NSData. Probably that is why it is dying. To fix this, it should load files by small data chunks and write them into file. As said before: didn't plan to use plugin for loading large files, so this is not implemented. |
Probably, use this delegate method. |
👋 Hi! Thank you for your interest in this repo. 😢 We are not using nordnet/cordova-hot-code-push anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork. 🔒 This will now be closed & locked. ℹ️ Please see #371 for more information. |
I tried to benchmark your plugin by adding approx 5000 dummy empty files to the project. So the size of the file chcp.manifest explode (normal)
So if there a a big amount of file, to improve the update process, we maybe first need to minimify the file or zip it.
For the min version everyone can use nodeJS like json-minify
For the zip solution the plugin should handle it.
Is there a way to do it ?
The installation phase took about 1minute now, just to update one file. (on my iPhone 6, should be worse on iPhone 5 or even old Android device)
It's because the checksum is calculated 5000 times "for nothing" and also moving the local files 5000 times
Maybe we can think about an improvement to prevent that time to explode ?
One thing is to reduce the project file first before using this plugin
thx @nikDemyankov for all your great work :)
The text was updated successfully, but these errors were encountered: