Performance: Why configuration matters
Configuration affects application startup time, resource usage, and runtime responsiveness by controlling how components load and behave.
spring.main.lazy-initialization=true
# Beans load only when first usedspring.main.lazy-initialization=false
# All beans load eagerly at startup| Pattern | Startup Time | Memory Usage | CPU Load | Verdict |
|---|---|---|---|---|
| Eager bean loading | High (slow startup) | High | Moderate | [X] Bad |
| Lazy bean loading | Low (fast startup) | Low | Low | [OK] Good |
| Verbose logging (DEBUG) | Moderate | Moderate | High | [X] Bad |
| Info logging level | Low | Low | Low | [OK] Good |
application.properties file?application.properties files.server.port=8080.application.properties content:spring.profiles.active=dev server.port=9090
dev profile?dev, and server.port=9090 is defined.server.port is set in the active profile, the app uses port 9090.application.properties and application-prod.properties. You want to run the app with the prod profile but the app still uses settings from application.properties. What is the likely cause?spring.profiles.active to select which profile config to load.spring.profiles.active is not set to prod, the app uses default application.properties.spring.profiles.active property is not set to prod. -> Option Ddev and prod environments in Spring Boot. Which approach correctly manages this using configuration?application-dev.properties and application-prod.properties with URLs and activating profiles is the standard way.application-dev.properties and application-prod.properties with respective URLs, then set spring.profiles.active accordingly. -> Option BPass the test and this pattern moves unknown