JDK-6874880 : Consider saving cache entries in the background
  • Type: Enhancement
  • Component: deploy
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2009-08-22
  • Updated: 2024-04-12
  • Resolved: 2017-02-23
Related Reports
Relates :  
Description
Generation of index files is not cheap process and it is not strictly needed to process with application startup. All we need is available in the jar file and we need to read it on first start anyway.

We should explore possibility to spawn background task to complete index file generation, so it will not block application startup. This should help to improve coldcache startup and well as startup after new lazy jars were loaded. 

Note that javaws -import should wait till index file generation is finished. Other applications may exit.

Comments
EVALUATION Saving cache entry is performed from DeployCacheHandler.close(), i.e. on close of input stream we got resource from. Theoretically, if caching is disabled app has everything it needs at this point and can proceed (but we will end up in different implementation of close()). So, technically if we launch saving in the background and will use whatever we downloaded to serve application requests we should be ok and win some time on the critical app thread. Note that this is not just about jars. Sample FX app at http://www.taranfx.com/gallery loads 100+ images and in FX number of concurrent image fetches is bound by 4. So, after image is loaded we still wait for it to be properly cached before we can start loading of next image.
01-09-2009