Quick revision
The short answer
Quarkus moves most framework work to the build: its extensions read annotations, configuration and dependency injection metadata during the build (build-time augmentation) and produce generated bytecode and recorded initialisation, so the application does little reflection or classpath scanning when it starts. Its CDI implementation, ArC, resolves beans at build time. The result is faster startup and lower memory on the JVM, and much more in a GraalVM or Mandrel native image, at the price of less run-time dynamism and extra reflection configuration for libraries without an extension.
What to remember
In this answer, we saw that Quarkus moves framework work from startup to the build. Extensions index annotations, read fixed configuration and generate bytecode and recorded initialisation, and ArC resolves dependency injection at build time and fails the build on wiring errors. That gives faster startup and lower memory on the JVM and much more in native images, in exchange for less run-time dynamism and reflection configuration for libraries without extensions. Spring Boot's AOT processing follows a similar idea with a narrower scope.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Quarkus moves most framework work to the build: its extensions read annotations, configuration and dependency injection metadata during the build (build-time augmentation) and produce generated bytecode and recorded initialisation, so the application does little reflection or classpath scanning when it starts. Its CDI implementation, ArC, resolves beans at build time. The result is faster startup and lower memory on the JVM, and much more in a GraalVM or Mandrel native image, at the price of less run-time dynamism and extra reflection configuration for libraries without an extension.
Why this question is asked
Startup time and memory used to matter little for a service that ran for weeks. With containers, autoscaling and serverless, they decide how fast we can scale and how many pods fit on a node, which is real money. Quarkus was designed around this, and interviewers ask about it to see whether we understand where startup time actually goes in a Java framework. In this answer, we will see what Spring Boot traditionally does at startup, what Quarkus does at build time instead, how ArC works, what that means for startup and memory, the trade-offs, and how Spring Boot's own AOT processing compares.
1What a Framework Traditionally Does at Startup
When a classic Spring Boot application starts, it scans the classpath for classes with annotations such as @Component, reads every auto-configuration candidate, evaluates their @Conditional rules, builds bean definitions, uses reflection to find constructors and injection points, creates proxies for transactions and other aspects, and binds configuration properties. All of that happens every time the application starts, on every pod, and the classes and metadata it loads for the work stay in memory.
None of this depends on anything that changes between two starts of the same build. The classpath is fixed in the container image, and most configuration is too. That observation is the starting point of Quarkus: if the answer is the same every time, compute it once, during the build.
2Build-Time Augmentation in Quarkus
Every Quarkus feature comes as an extension, and each extension has two parts: a runtime part that ships with the application and a deployment part that runs only during the build. During the build, the deployment parts index the application's classes with Jandex, a fast annotation index, find the annotations they care about, read the configuration that is fixed at build time, and decide what to generate. This step is called augmentation.
The output is ordinary bytecode: generated classes that create beans directly with new instead of reflection, and recorded initialisation steps. Recording means an extension calls methods on a recorder object during the build, Quarkus writes those calls down as bytecode, and at startup the application simply replays them. For example, the Hibernate ORM extension parses entity mappings during the build, so at startup Hibernate does not scan for entities.
| Step | Classic Spring Boot | Quarkus |
|---|---|---|
| Find annotated classes | classpath scan at startup | Jandex index at build |
| Decide which beans exist | conditions at startup | ArC at build |
| Create and inject beans | reflection at startup | generated code with new |
| Parse entity mappings | at startup | at build, recorded |
| Fixed configuration | bound at startup | read at build |
| Runtime configuration | at startup | at startup (still allowed) |
3ArC: Dependency Injection Resolved at Build Time
Quarkus uses CDI (Contexts and Dependency Injection, the Jakarta EE standard), implemented by ArC. ArC finds all beans and injection points during the build, checks that each injection point has exactly one matching bean, and generates the factory classes. An ambiguous or unsatisfied dependency fails the build, not the first request in production.
The cost is that ArC implements CDI Lite plus most of the full specification, but not everything that depends on run-time discovery. CDI portable extensions, which change beans while the container starts, are not supported, and some rarely used features are missing; check your version's list. In return, ArC also removes beans that nothing uses, which makes the application smaller.
4Effect on Startup Time and Memory
Because the application starts by replaying prepared steps, a simple REST plus database service in JVM mode typically starts in around a second and uses noticeably less heap than the same service with run-time scanning; exact numbers depend heavily on the application, so measure your own. The bigger difference comes in native mode. GraalVM, or Mandrel, the Red Hat distribution of GraalVM aimed at Quarkus, compiles the application ahead of time into a native executable. Quarkus's build-time work fits this well, because almost nothing is left to discover at run time, and such services often start in tens of milliseconds with a resident memory of a few tens of megabytes.
But there is a catch. The less the application decides at run time, the less it can change at run time. Configuration that is fixed at build time needs a rebuild to change. And in native mode, any library that uses reflection, dynamic proxies or resources without a Quarkus extension to register them needs explicit configuration, for example @RegisterForReflection or a reflection configuration file, or it fails at run time.
5How Spring Boot's AOT Processing Compares
Spring Boot 3 added AOT (ahead-of-time) processing. During the build, Spring starts the application context in a special mode, evaluates the conditions, and generates Java source code that registers the resulting bean definitions directly, plus hints for reflection, proxies and resources. This is required for GraalVM native images and can also be used on the JVM.
The idea is similar, but the scope is different. Spring AOT freezes the bean definitions and the classpath decisions, so profiles and conditions are fixed at build time, but the context is still refreshed and beans are still created at startup, and the large Spring ecosystem was designed for run-time flexibility first. Quarkus was designed for build-time work from the start, so each extension pushes more into the build. Spring Boot also offers other startup aids, such as class data sharing and JVM AOT caches in recent Java versions and CRaC checkpoint and restore; check your versions.
6Follow-up questions
How does Spring Boot's AOT processing compare?
Spring AOT also runs at build time: it evaluates conditions, generates code that registers bean definitions and produces reflection hints, which native images need. But it freezes decisions rather than removing the container's work, since the context still refreshes and creates beans at startup. Quarkus pushes more into the build through its extensions, so in JVM mode it usually starts faster, while in native mode both start in tens to hundreds of milliseconds. Spring's advantage is that most of its huge ecosystem works unchanged.
Does Quarkus forbid reflection completely?
No. Reflection works in JVM mode as usual, and in native mode it works for classes registered at build time. Quarkus extensions register what their libraries need automatically. The rule is only that the framework itself avoids reflection where it can, and that native images must know about reflective access in advance.
Can I change configuration without rebuilding a Quarkus application?
Most configuration, such as URLs, credentials and pool sizes, is read at run time as usual. Only properties that affect what is generated, such as which database kind is used or whether a feature is included, are fixed at build time, and Quarkus documents each property's phase and warns when one is changed at run time.
7Conclusion
In this answer, we saw that Quarkus moves framework work from startup to the build. Extensions index annotations, read fixed configuration and generate bytecode and recorded initialisation, and ArC resolves dependency injection at build time and fails the build on wiring errors. That gives faster startup and lower memory on the JVM and much more in native images, in exchange for less run-time dynamism and reflection configuration for libraries without extensions. Spring Boot's AOT processing follows a similar idea with a narrower scope.
Open with
Classic Spring Boot does a lot of work every time it starts: it scans the classpath, evaluates auto-configuration conditions, uses reflection to build and inject beans, and creates proxies.
Then, if they want more
Quarkus observes that for a given build all of that gives the same answer, so it moves it to the build. Each extension has a deployment part that runs at build time: it indexes classes with Jandex, reads build-time configuration, and generates bytecode, including recorded initialisation steps that are just replayed at startup.
Hibernate entity parsing, for example, happens during the build. Its CDI implementation, ArC, resolves all beans and injection points at build time, generates factories that use new instead of reflection, removes unused beans, and fails the build on missing or ambiguous dependencies. The trade-off is that some dynamic CDI features like portable extensions aren't supported.
The effect is faster startup and less memory even in JVM mode, and in a GraalVM or Mandrel native image startup in tens of milliseconds. The cost is less runtime flexibility: some properties are fixed at build time, and libraries without an extension need reflection registration in native mode.
Spring Boot's AOT is similar in spirit but narrower: it pre-computes bean definitions, while the context still refreshes at startup.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Spring Boot 3
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "What does Quarkus do at build time that Spring Boot traditionally does at startup, and...": https://scrivio-interview-library.netlify.app/java/other-java-frameworks/f265066cd8/