This project aims at finding the limits imposed by the Java class format when dealing with code generation.
The main class is Benchmark.kt
and contains a few hardcoded
options you can opt in/out.
The benchmark works by using a BenchmarkCase
,
which describes everything to generate a piece of code.
The benchmarking engine will then try to find the limit for each case and report it.
First, a slow start to guess the upper bound, then refines it with a binary search.
All the data is in the same class. This tests various keywords influence on the number of field it's possible to have.
Evaluates what happens when a complex object is used to initialize each field.
Evaluates what happens when the data is extracted to a different class
A model to overcome the class file limitation by using the class hierarchy to spread the declarations in several files.
- Review the benchmark options above the main function.
- Free several GB of disk space.
- Execute the main function in
Benchmark.kt
. - Clean up the
generated
folder.
The java class parser has been generated by Kaitai 0.8 using https://raw.githubusercontent.com/kaitai-io/kaitai_struct_formats/cff316d911301d74c0dde5cc3019f6e489f85ec7/executable/java_class.ksy
Add option to clear the generated data of each test.
This is the result of force feeding a duck and that's how I felt when I was giving the compiler my generated source code.
Please be nice and don't do that to your duck :3
Also don't do that to your classes, as flirting with the limits may break tools relying on bytecode modification.