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 dependencies 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.

The annotations processing is separated into a standard plugin that is used by default and allows for generation of missing dependencies. Yet if you need to implement a complex business logic, you can either use ActiveInject DSL, or even create your own annotations processing plugins.

The DSL provides support for programmatic binding generation, introspections of dependencies graphs, transformations, automatic generation of missing bindings, and modification of the already existing bindings. This way you can use the full power of Java to algorithmically create complex bindings and dependencies graphs directly in runtime with respect to the runtime information and settings.

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

You can add ActiveInject to your project by importing its Maven repository.
These docs cover the most recent release of ActiveInject which is v3.0.1, published Nov 30, 2020 (see on Github or Maven ).

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 ActiveJ website.