Hi,
What we found in Open Liberty has been:
* Initial consumption of class and annotations data uses simple queries, generally:
** What are the classes which have a specified annotation, e.g., what classes have WebServlet as a class annotation.
** What is the implementation hierarchy of a particular class.
* Cache data must include inheritance and qualifier information in addition to the basic annotations data. (This additional data is contained within Jandex indexes.)
* Using JARs as the unit of index generation and of index composition works well. In particular, that enables the sharing of indexes between different consumers of the data (for example, Servlet, WebService, or CDI), each which may want to compose the indexes differently.
* For complete inheritance data, a listing of specific unresolved class references (mostly, superclass and interface references) is needed. Open liberty index composition has a final step of chasing down unresolved class references in the external references class loader.
* When working with Web Modules, composition requires the labeling of index data as being from a metadata-complete or omitted from absolute ordering regions of the web module. This is an ugly but unfortunate consequence of how different processing consumes the data.
Using a simplified API means that initial processing is able to use just a subset of the Jandex index data. (Open Liberty wrote a custom, lightweight reader, specifically to read the subset data.) This means that "Info" objects don't need to be instantiated, and, within Open Liberty, that Jandex string instances can be placed with Open Liberty managed strings.
(Use of a simplified API also enables the creation of a secondary layer of caches, which would be a cache of query results. For scenarios where there is a fixed "scan and process" phase, the queries which are performed should be fixed, with the result that subsequent starts could rely on there being complete query cache data, which would in turn could completely avoid the need to load indexes. This seems to be, in effect, what new very lightweight server implementations are doing, with the query results being embedded into a server image as code.)
Thomas F. Bitonti
WebSphere Application Server
Jason Greene ---03/18/2021 05:22:05 PM---Hey guys, In case it’s helpful I am happy to provide some insight on Jandex. I originally created t
From: Jason Greene <jason.greene@xxxxxxxxxx>
To: jakartaee-platform developer discussions <jakartaee-platform-dev@xxxxxxxxxxx>
Date: 03/18/2021 05:22 PM
Subject: [EXTERNAL] Re: [jakartaee-platform-dev] Scanning specification
Sent by: "jakartaee-platform-dev" <jakartaee-platform-dev-bounces@xxxxxxxxxxx>
Hey guys, In case it’s helpful I am happy to provide some insight on Jandex. I originally created the project during WildFly’s inception for optimal annotation scanning. Over time it ended up being more of an offline reflection/introspection Hey guys,
In case it’s helpful I am happy to provide some insight on Jandex. I originally created the project during WildFly’s inception for optimal annotation scanning. Over time it ended up being more of an offline reflection/introspection system with an emphasis on reduced memory consumption, and optimized index storage, since the target at the time was dynamic runtime deployment. It’s now used in number of other contexts, including the build time offline introspection in Quarkus.
It is actually designed to support multi-jar indexing (e.g. [1]). The reason base Indexes are intended to be scoped to a single JAR is to adapt to a variety of topologies and support software updates. For example if A.jar depends on B.jar, and you index both and store the index in A.jar, a subsequent update to a newer version of B.jar leads to an invalid index stored in A.
The expectation is that an application runtime will aggregate these indexes in a way that maps to the class loader strategy utilized in their implementation, and the users packaging approach. CompositeIndex[1] is a simple flat multi-jar example of this. It’s also designed to handle incomplete classpaths (as I am sure you all know is very common in EE deployments where random artifacts get thrown an) and unlike ClassLoaders will support introspection of types with broken/incomplete linkage.
Regarding API usability, I agree for this use case you want something simpler. For example Jandex utilizes DotNames to reduce memory using a radix tree in place of standard string access. While reasonable for an application server implementation that prioritizes resource usage, a standard EE user won’t care and just wants to lookup things by name without going through an indirection Name type. So an EEish API should probably should just use standard String like the Java reflection API (this is easily mappable to Jandex if internally used). CDI-Lite’s extension API proposals have done exactly this[2]. Although in this example, it’s a push API based to allow for new CDI implementations that are APT based (e.g. Micronaut)
BTW this is somewhat of a tangent but I think EE10 should consider pruning the complexity of hierarchical deployment architectures (e.g. ears), and the variety of scoping (nested jars tend to share a CL, and wars tend to be isolated). If you go to a standard simple flat deployment model like all users expect, you make your life (and your users) a heck of a lot easier.
Thanks,
-Jason
[1]
https://docs.wildfly.org/jandex/org/jboss/jandex/CompositeIndex.html[2]
https://github.com/Ladicek/StillDI
On Mar 18, 2021, at 1:46 PM, Thomas Bitonti <bitonti@xxxxxxxxxx> wrote:
+1
Jandex provides an approximate solution, but needs more lightweight ways to access index data.
Requirements become more complicated if the scope of caching becomes larger than a single JAR.
Things get more complicated also if the cache data is to be consistent with what a class loader sees, vs what can be seen working directly with resources.
Thanks!
Thomas F. Bitonti
WebSphere Application Server
<graycol.gif>arjan tijms ---03/17/2021 11:47:32 AM---Of course +1 from me. HK2 and Jandex are both inspirations to start from. In HK2, build-time
From: arjan tijms <arjan.tijms@xxxxxxxxx>
To: jakartaee-platform developer discussions <jakartaee-platform-dev@xxxxxxxxxxx>
Date: 03/17/2021 11:47 AM
Subject: [EXTERNAL] Re: [jakartaee-platform-dev] Scanning specification
Sent by: "jakartaee-platform-dev" <jakartaee-platform-dev-bounces@xxxxxxxxxxx>
Of course +1 from me. HK2 and Jandex are both inspirations to start from. In HK2, build-time scanning has an important role, and the so-called hk2-inhabitant-generator is often used. See this article from Jonathan that shows this: https://blog.payara.fish/hk2-the-hundred-kilobyte-kernel
Of course +1 from me.
HK2 and Jandex are both inspirations to start from. In HK2, build-time scanning has an important role, and the so-called hk2-inhabitant-generator is often used. See this article from Jonathan that shows this: https://blog.payara.fish/hk2-the-hundred-kilobyte-kernel
On Wed, Mar 17, 2021 at 4:01 PM Thiago Henrique Hupner <thihup@xxxxxxxxx> wrote:
+1
Em qua, 17 de mar de 2021 12:00, Reza Rahman <reza_rahman@xxxxxxxxx> escreveu:
+1. I believe this has been discussed in the Servlet specification in the past. I know David Blevins has mentioned this over the years too.
On Mar 17, 2021, at 10:53 AM, Steve Millidge (Payara) <steve.millidge@xxxxxxxxxxx> wrote:
I changed the title so an not to hijack the thread RE: Profiles.
I’d be in favour of a scanner spec or even SPI to also include a common Jar index format so all Jakarta specs could use the scan metadata and any cached metadata from the jar. HK2 already has a rudimentary api for Types Repository (glassfish-hk2/Types.java at master · eclipse-ee4j/glassfish-hk2 (github.com)) and a Scanner glassfish-hk2/Parser.java at master · eclipse-ee4j/glassfish-hk2 (github.com)
What is the best way to kick of an initial discussion? An issue in the Platform Project repo?
Steve
From: jakartaee-platform-dev <jakartaee-platform-dev-bounces@xxxxxxxxxxx> On Behalf Of Jesse McConnell
Sent: 17 March 2021 12:03
To: jakartaee-platform developer discussions <jakartaee-platform-dev@xxxxxxxxxxx>
Subject: Re: [jakartaee-platform-dev] Additional profiles
Speaking of scanning, that ought to be a spec in of itself at this point, so the entire application gets scanned once and all of the various APIs can make use of that scan data, servlet would definitely benefit from this. That would be a good extension to the core profile, which I quite like the name of.
Looking back to David's original premise though, it appears that we're less creating novel profiles and more just segmenting the existing ones and building up. Is this a situation where web profile would rely upon a specific version of a specification or a version of a core profile?
I do support separately releasing profiles.
Jesse
On Wed, Mar 17, 2021, 05:56 arjan tijms <arjan.tijms@xxxxxxxxx> wrote:
Hi,
On Wed, Mar 17, 2021 at 3:11 AM David Blevins <dblevins@xxxxxxxxxxxxx> wrote:
- Faces and standard tag libs add significantly to startup times due to TDL scanning and annotation scanning.
Actually Faces (at least Mojarra) doesn't do any annotation scanning itself. It uses the annotations that are handed to it via the @HandlesTypes in the ServletContainerInitializer. I guess it depends on the Servlet container if this triggers explicit extra annotation scanning or not.
Faces and Pages do .tld (and in case of Faces -taglib.xml) scanning indeed which has some cost since it looks for patterns.
Kind regards,
Arjan Tijms
_______________________________________________
jakartaee-platform-dev mailing list
jakartaee-platform-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev
_______________________________________________
jakartaee-platform-dev mailing list
jakartaee-platform-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev
_______________________________________________
jakartaee-platform-dev mailing list
jakartaee-platform-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev
_______________________________________________
jakartaee-platform-dev mailing list
jakartaee-platform-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev_______________________________________________
jakartaee-platform-dev mailing list
jakartaee-platform-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev
_______________________________________________
jakartaee-platform-dev mailing list
jakartaee-platform-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev
_______________________________________________
jakartaee-platform-dev mailing list
jakartaee-platform-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartaee-platform-dev
_______________________________________________