Closed Bug 813466 Opened 13 years ago Closed 8 years ago

shared libs feature

Categories

(Firefox OS Graveyard :: Gaia, enhancement)

ARM
Gonk (Firefox OS)
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: baptiste.mouterde, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0 Build ID: 20121025205329 Steps to reproduce: installing a lot of apps to a low-memory phone Actual results: Duplicated js libs : if I got 10 app that used jquery-mobile-x-y.js I will have this file 10 times on my phone Expected results: workflow : https://docs.google.com/drawings/d/18HRWF-K6TOR2OOuNmM8Z86V1iIDNdL775RNpTgfxqJ8/edit in text : Apps should ask for a lib in their manifest, saying : I need lib A version x.x.x from randomu.rl then b2g look if the libs A from the phone and the link are the same if so, it's done else b2g download it. Also b2g could use a libs repository but it's less attractive due to the need of repository handler which result on a less freedom for devs (on green on the workflow)
We don't sure that the same URL is always returning the same copy of JS. The content of an URL is changing by time. The installed apps using the same JS URL may use different copies of the JS since their update time is various. The concept of application cache is create a snapshot of URLs while an app is installed/updated. It is possible and necessary to have several copies of the same JS at the same time. But, we still can reduce size of cached content by remove duplicated content (same version).
(In reply to Thinker Li [:sinker] from comment #1) > We don't sure that the same URL is always returning the same copy of JS. > The content of an URL is changing by time. The installed apps using the > same JS URL may use different copies of the JS since their update time is > various. The concept of application cache is create a snapshot of URLs > while an app is installed/updated. It is possible and necessary to have > several copies of the same JS at the same time. But, we still can reduce > size of cached content by remove duplicated content (same version). I understand the fact about URL but I don't really get the one about "having several copies of the same JS at the same time", If it's possible to do a diff or if it's possible to use md5sum then app just have to provide md5sum or original JS lib in order to use less space? I think this will result in your last sentence but I'm not sure. Also thanks for answer :)
Whatever, we should download files before eliminating duplications. Creating a background thread to compute hash code of new files and rename file names to their hash code strings. This can eliminate duplications. But, we need to keep a reference count for each file to make sure all referenced files alive.
(In reply to Thinker Li [:sinker] from comment #3) > make sure all referenced files alive. what can destroy such file? - uninstall - bugs for the first one we should parse manifests in order to find if the lib is shared or not (this avoid using db just for this) for the second one we should run a task each morning or whenever that parse manifest aswell and look for missing file (avoiding DB aswell but may be useless with a file monitoring)
Thanks for filing this bug. As the bug was filed a long days ago, I suppose it may have been resolved. Would you kindly check again and let me know , if you can re produce the bug Now or not. This thing will be really appreciated. If you could re produce the bug , please let me know your device name and OS version. Regards
Flags: needinfo?(baptiste.mouterde)
Severity: normal → enhancement
Component: Gaia::System → Gaia
OS: All → Gonk (Firefox OS)
Hardware: All → ARM
Closing the bug, as there has been no response after couple months/couple years.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Flags: needinfo?(baptiste.mouterde)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.