Menu

#4 caching failed resource lookups

open
None
5
2010-10-29
2010-10-25
Anonymous
No

I'm not sure if onejar is doing this or not but I think one-jar caches successful getResource() calls but doesn't cache unsuccessful getResource() calls. The end result is getResource() when the resource exists is very fast but when it doesn't exist is very slow.

Discussion

  • P. Simon Tuffs

    P. Simon Tuffs - 2010-10-29
    • assigned_to: nobody --> simontuffs
     
  • P. Simon Tuffs

    P. Simon Tuffs - 2010-10-29

    I think you're right, failed resource lookups are not cached. I'm not sure this is always safe: classpaths can be dynamically manipulated by applications (e.g. installing a new .jar file to add drivers). I could make a use-case for making cached-failed-resources an optional manifest property (default false), when setting true would improve performance. I'll put this in my (growing) list of things to do (possibly 0.98)

     

Log in to post a comment.