Code Generation

Talks about: , and

How long YoSQL takes to read .sql files, parse them, and write the Java — which is time added to every build of every project that uses it.

What is measured

Three sizes — 10, 25 and 50 repositories — in each of five logging configurations:

ConfigurationWhat it generates
no loggingThe baseline. No logging statements at all.
java.util.loggingLogging through the JDK’s own API.
log4jLogging through log4j.
slf4jLogging through slf4j.
tinylogLogging through tinylog.

Every repository holds the same eight statements: a stored-procedure call and several of them, a write and several, a read and several, an update and several.

The published results

The results are what a shared GitHub Actions runner measured, and should be read as an order of magnitude rather than a measurement — see reading the numbers .

What they show, and what holds across machines:

If code generation genuinely is on your critical path, the way out is not a setting: generate the repositories in one module and depend on it from the others, so the work happens once.

Running it

mvn --projects yosql-benchmarks/yosql-benchmarks-codegen --also-make \
  --activate-profiles benchmarks verify

The run writes target/benchmark/yosql-benchmarks-codegen.json. It takes tens of minutes and wants a machine with nothing else on it — a laptop compiling something else in another window will produce numbers that mean nothing.