apache / apache/fory

[java] Compile time processing of row format codecs

Open
#3,671 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
4.5k
Forks
443
Avg merge
5h 59m
Merged PRs (30d)
77

Description

### 💡Feature Request

Currently, Fory Java will generate all row codec classes at runtime. You can see it print in the application startup logs - generate source code, compile, load class.

Java supports compiler hooks in the form of annotation processors. This allows you to inspect code under compilation, generate new code, and then have javac continue to compile that.

Would it make sense to add support to Fory to pre-generate codec classes during compile time? Then your deployable application already has all classes available, potentially pre-verified and pre-linked using class data sharing, without bringing a compile step into runtime.

I note some open issues about foryc compiler with a Maven plugin, but this seems to be a different issue, more related to IDL compilation.

The generated code will be less flexible - not possible to dynamically link in an updated version of Fory, you must inline any runtime Fory deps.

Is this an interesting approach? If it would not conflict with any other project future directions, I might attempt a prototype at some point.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.