DEV Community

Dylan Watson
Dylan Watson

Posted on • Edited on

1

Java/Angular Build Speed Improvements

I've been inspired to fix our build times after watching:

I'll be updating this as I investigate different techniques this week.

Here are a list of improvements and the effect they had on build times.

Java & Spring Boot

Spring lazy init

spring.main.lazy-initialization=true
This made the build twice as slow.. and broke the swagger tests as some of the endpoints didn't get instantiated.

Logging

Reduce all logging to only log on WARN
logging.level.root=WARN

Have a single "test" profile

The more profiles you have in tests, the more the spring DI ApplicationContext cache has to be reset. This can have a massive speed impact on your tests.

Test Slices

https://www.baeldung.com/spring-tests#5-using-test-slices

Turn integration tests into unit tests

This one requires considering that integration tests or "SpringBootTests" are really just testing that spring is configured correctly.
Most of the logic should be in fast unit tests.
Have maybe a single integration test

Typescript/Angular/Jest

Switch to Jest

Use @swc-node/jest

https://github.com/Brooooooklyn/swc-node

Use babel for jest

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay