eclipse-plugins
eclipse-plugins copied to clipboard
[CMSIS-Pack] Refresh operation slow => Retrieve pack size lazy
Operation Utils.getRemoteFileSize() during pack refresh take 15% of the time. The result is used in the UI only sometimes (only if versions are displayed, package is being installed, version is selected). Would be good to change this to retrieve size lazy.
your observation is generally right, getting file size is expensive.
however the main problem is to detect if the file is available or not, getting the size is a bonus.
the CMSIS Packs design has a small flaw, the index does not refer to all existing versions, i.e. it is not possible to tell which versions are available. the index only refers to a pdsc file (the version inside the index is also not reliable, the pdsc file may be newer than the index); the pdsc file then lists several versions, but not all of them are available, so the only way to tell is to iterate them.
as you noticed, this approach is expensive, and a lazy access would be a better solution.