Lightning-fast and ultimately powerful Dependency Injection

What is ActiveInject?

ActiveInject is a lightweight and powerful dependency injection library with ultimate performance and no third-party dependencies. It is multi-thread friendly, feature-rich, and can boast with lighting-fast start-up time and runtime, significantly outperforming Spring DI or Guice.
ActiveInject is one of the ActiveJ technologies, but it has minimal third-party dependencies and can be used as a stand-alone component.

Why ActiveInject?


Support of nested scopes, singletons and transient bindings, modules, optimized multi-threaded and single-threaded Injectors

Thoroughly optimized

Entire runtime code of Injector consists of ~50 lines of code, and all the dependencies graph preprocessing is performed at startup time


All reflection is entirely optional and abstracted out in a separate module. Also ActiveInject is fully transparent for introspection of the dependency graph


ActiveInject has no third-party dependencies on its own. Can be used in a lightweight embedded Dependency Injection mode

Dependency Injection: Redefined

Enjoy development with a wide range of powerful tools. ActiveInject simplifies development, debugging, refactoring and reusing of your code without restrictions and overhead. It features a very efficient and familiar DSL along with extensive use of Java 8+ functional-style programming.

Besides being extremely convenient, ActiveInject is 5.5 times faster than Guice and up to 100s times faster than Spring due to zero third-party dependencies and no overheads during runtime.

Module cookbook = new AbstractModule() {
	Sugar sugar() { return new Sugar("Sugar", 10.f); }

	Butter butter() { return new Butter("Butter", 20.0f); }

	Flour flour() { return new Flour("Flour", 100.0f); }

	Pastry pastry(Sugar sugar, Butter butter, Flour flour) {
		return new Pastry(sugar, butter, flour);

	Cookie cookie(Pastry pastry) {
		return new Cookie(pastry);


We’ve compared ActiveInject to Guice and Spring in the same scenario using JMH as the benchmark tool. We ran benchmarks in AverageTime mode and made 20 measurements.

Dependency Injection
ActiveInject - 7.2 Mrps Guice - 1.3 Mrps Spring - 1.3 Krps
7.2 Mrps
1.3 Mrps
1.3 Krps

Add ActiveInject to your project

Add ActiveInject Maven repository to your project. Note that ActiveInject is a stand-alone technology and has no third-party dependencies.

Project background

ActiveInject is one of the ActiveJ technologies that also include cloud solutions, lightning-fast serializers, bytecode generators and others. To learn more about ActiveJ ecosystem, visit website of the core ActiveJ platform.