Currently there is a code path in the jimage ImageReader class which does a double lookup for the majority of requests, and this could be improved.
This is written as is due to the nature of the JRT file system naming convention vs the jimage naming convention (it's easier to test the given name which matches "directories" before the resource name, but resources are much more likely to be what's being looked-up).
In addition to this, the need for a sub-string of the given path means there's always allocation and string copying needed to lookup resource entries.
This will affect Java based class loading and JRT file system performance/memory usage.
The idea is to allow jimage hashcode generation to start at an offset in the string, thus allowing the resource substring to be tested first without needing to create a substring.
This requires plumbing a start index into both hashcode generation and verification code.
This is likely to be easiest to implement in lworld/valhalla first because that already has some significant changes and dead-code removal in jimage reader code for preview mode support.
This is written as is due to the nature of the JRT file system naming convention vs the jimage naming convention (it's easier to test the given name which matches "directories" before the resource name, but resources are much more likely to be what's being looked-up).
In addition to this, the need for a sub-string of the given path means there's always allocation and string copying needed to lookup resource entries.
This will affect Java based class loading and JRT file system performance/memory usage.
The idea is to allow jimage hashcode generation to start at an offset in the string, thus allowing the resource substring to be tested first without needing to create a substring.
This requires plumbing a start index into both hashcode generation and verification code.
This is likely to be easiest to implement in lworld/valhalla first because that already has some significant changes and dead-code removal in jimage reader code for preview mode support.