JarClassLoader performance could be enhanced
- Dominant language
- Java
- Stars
- 3.1k
- Forks
- 935
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 17
Description
### Description
Currently the JarClassloader is kind of slow. It iterates over ALL present jars, when queried for ressources or classes. This leads to drastic perfomance losses with lots of jars and many resource requests. There is no caching.
### Use case/motivation
In our netbeans platform project Hibernate initialisation takes 40 seconds (compared to the same initialisiation in a Unit test which takes 4 seconds). Hibernates looks for a lot of SPI Lookups and Flyway looks for sql migratrion files for example.
We made our own adapted version of the JarClassloader which remembers which classes/resources are located in which jars and this improved perfoamce drastically for the whole application. This approach might not be feasibly for the netbeans product as such but it shows that there is room for performance improvements.
### Related issues
_No response_
### Are you willing to submit a PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow the Apache Software Foundation's [Code of Conduct](https://www.apache.org/foundation/policies/conduct.html)
Contributor guide
Research direction
Start at the JarClassLoader entry point and trace how class and resource requests iterate over present JARs; the issue provides no file or test name. Compare behavior using the Hibernate initialization and Flyway migration lookup examples, and define completion around a measured reduction in lookup time without breaking class or resource discovery.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- performance, tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100