Data comparison between rust's spring-rs and java's springboot

Posted 2024-09-04 05:19:42 ‐ 2 min read

The size of the release binary built with spring-rs is half of the SpringBoot jar package. Build Target Size

The size of the Docker image built with spring-rs is 1/4 of the SpringBoot image. Docker Image Size

The runtime memory usage of using spring-rs is 1/10 of that of SpringBoot. Runtime Memory Usage

The QPS of the simplest web application using spring-rs is twice that of SpringBoot. Raw Query QPS

The QPS of a web application with database queries using spring-rs is basically the same as SpringBoot. Postgres Query QPS

The data query tool currently used is sqlx. sqlx's performance support for MySQL is very poor, and the stress test results are only half of SpringBoot, so it is recommended to use PostgreSQL as the backend of sqlx.

Next, I will connect to rust-postgres to see if the performance will be improved compared to sqlx.

Detailed stress test code and related data can be found in this link