Ultra-fast Dependency Injection for Java - Zero Reflection, Pure Code Generation
Veld is a compile-time Dependency Injection framework that generates pure Java code. Zero reflection at runtime means maximum performance - up to 100x faster than Spring in dependency resolution benchmarks.
Designed for developers who want maximum performance, full control, and zero runtime magic.
Maven:
<dependency>
<groupId>io.github.yasmramos</groupId>
<artifactId>veld-annotations</artifactId>
<version>1.0.4</version>
</dependency>Gradle:
implementation 'io.github.yasmramos:veld-annotations:1.0.4'<build>
<plugins>
<plugin>
<groupId>io.github.yasmramos</groupId>
<artifactId>veld-maven-plugin</artifactId>
<version>1.0.4</version>
</plugin>
</plugins>
</build>import io.github.yasmramos.veld.annotation.Component;
import io.github.yasmramos.veld.annotation.Inject;
@Component
public class UserService {
private final UserRepository repository;
@Inject
public UserService(UserRepository repository) {
this.repository = repository;
}
public User getUser(Long id) {
return repository.findById(id);
}
}import io.github.yasmramos.veld.Veld;
public class Main {
public static void main(String[] args) {
UserService userService = Veld.userService();
User user = userService.getUser(1L);
}
}| Feature | Veld | Spring | Guice |
|---|---|---|---|
| Reflection at runtime | None | Heavy | Moderate |
| Startup time | ~0.1ms | ~500ms+ | ~100ms |
| Injection speed | ~0.001ms | ~0.01ms | ~0.005ms |
- Up to 100x faster than Spring in dependency resolution benchmarks
- 3ns average injection latency
- 0.003ms startup time
- Zero runtime reflection overhead
| Topic | Location |
|---|---|
| Quick Start | docs/quickstart.md |
| Annotations Reference | docs/annotations.md |
| Architecture | docs/architecture.md |
| Module | Description |
|---|---|
veld-annotations |
Core annotations |
veld-processor |
Annotation processor |
veld-weaver |
Bytecode weaving |
veld-maven-plugin |
Unified build plugin |
veld-aop |
Aspect-Oriented Programming |
veld-security |
Method-level security |
veld-benchmark |
Performance benchmarks |
git clone https://github.com/yasmramos/Veld.git
cd Veld
mvn clean installVeld - Dependency Injection at the speed of direct method calls.