Sgitario / frameworks-benchmarks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Benchmark Results

API Framework Versions:

  • Quarkus 2.9.2.Final
  • Spring Boot 2.7.0

For Simple REST application

Simple REST GET endpoint that returns a static string. Module: Rest Benchmark Source Code:

import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

@Path("/ping")
public class PingResource {

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String ping() {
        return "pong";
    }
}
  • Throughput (the higher the better)

Throughput

  • Average Time (the lower the better)

Average Time

For Data Blocking application

Using blocking API to connect to a PostgreSQL database instance. This benchmark will create a fruit, will get this fruit and finally it will delete it.

Module: Data Blocking Benchmark Source Code:

@Entity
public class Fruit {
    @Id
    @GeneratedValue
    private Long id;
    private String name;
}

@ApplicationScoped
public class FruitRepository {
    // ...
}

@Path("/api/fruits")
public class FruitResource {

    @Inject
    FruitRepository repository;

    @GET
    @Path("/{id}")
    public Fruit get(@PathParam("id") Long id) {
        // ...
    }

    @POST
    public Fruit post(Fruit fruit) {
        // ...
    }

    @DELETE
    @Path("/{id}")
    public void delete(@PathParam("id") Long id) {
        // ...
    }

}
  • Throughput (the higher the better)

Throughput

  • Average Time (the lower the better)

Average Time

For Data Reactive application

Same application as in Data Blocking application but using the Reactive API for both Quarkus and Spring.

  • Throughput (the higher the better)

Throughput

  • Average Time (the lower the better)

Average Time

About

License:Apache License 2.0


Languages

Language:Java 100.0%