Jandex improved API for embedded devices

12 views
Skip to first unread message

Michael Gr.

unread,
Jul 4, 2025, 12:42:51 PMJul 4
to SmallRye
Hi all, do you plan to strip-down the Jandex library so that it could be also used on embedded devices as API (e.g. splitting the generating part from using the index part)?
Of course it would also run in the way it is but it's not "embedded-like".
Such tool API should not have more than 150 KB of size.
Best regards, Michael

Ladislav Thon

unread,
Jul 4, 2025, 5:32:37 PMJul 4
to SmallRye
Hi, 

I'm not sure why you would want Jandex without the indexing part -- to be honest, I don't think it would make too big of a difference. Jandex 3.3.2 weights at nearly 400 KBs, which seems OK to me. If I'd try to remove the indexing part, I don't think it would get rid of more than 100 KBs. It's a guess for sure, but an educated guess at the same time. 

If you feel like you can get rid of significantly more, feel free to check that and report back. I don't think I'd want to split Jandex, because a single JAR without dependencies is a part of Jandex compatibility story, but if you are able to shrink the JAR down significantly, maybe we can reconsider. 

LT

Dne pá 4. 7. 2025 18:42 uživatel 'Michael Gr.' via SmallRye <smal...@googlegroups.com> napsal:
--
You received this message because you are subscribed to the Google Groups "SmallRye" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smallrye+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/smallrye/8bfbbbd2-3551-40a2-a8de-a564322c3ad6n%40googlegroups.com.

Ladislav Thon

unread,
Jul 6, 2025, 4:48:42 PMJul 6
to Michael Gr., SmallRye
Hi,

Dne ne 6. 7. 2025 21:12 uživatel Michael Gr. <gram...@googlemail.com> napsal:
Hi,

thanks for your answer.
The indexing part would be part of the build time if I understood it well.
On embedded platforms I would just want to use the index files for faster JVM-based access during startup-time (not especially GraalVM).

That is how Jandex is typically used, even WildFly supports that.

I've also read that maybe Java 17 is considered. That would be also a target for embedded platforms but the most still run on Java 8.

Jandex is still a Java 8 project. I'm intentionally conservative here and don't plan to bump to a newer Java version anytime soon.

Is there a documentation available for the index file itself?

No. The format is not documented, although the reader/writer classes in the codebase make the structure of the format fairly clear. I wouldn't recommend reimplementing it, though, because it can change at any time (recently, I've been thinking about creating a V3 format that would no longer need versioning, because versioning has been a constant hassle; no specific design or code yet).

Maybe I can create a small Java 8 compliant client API (maybe keeping compliant to the API of Jandex itself) which just uses the index files.
I've the feeling that such a client API could be < 100 KB.

I feel like if you drop only the indexing part, you'll only be able to drop `Indexer` and `IndexWriter`. Those are pretty big classes, but I doubt they themselves consist of 300 kBs. So to be able to get to < 100 kBs, you'd have to remove some parts of the API as well. That would of course be possible (I've recently added APIs that might be useless to you, such as `EquivalenceKey` and `AnnotationOverlay`), but at that point, I feel like you're creating a whole new project.

I personally don't think that Jandex is a big project, but I also readily admit that JAR size has never been a concern to me -- unlike memory footprint and to a degree also raw speed.

LT


Background: I'm currently planning and developing a platform for embedded devices similar to Spring and Quarkus but with focus on the requirements and security issues for embedded devices.

Best regards,
Michael
Reply all
Reply to author
Forward
0 new messages