Native boot quick,but same interface program,Jar mode is faster than native mode
@GetMapping("/map")
public Object map() {
Map<String, Object> map = new HashMap<>();
map.put("wgh1", 12);
map.put("wgh2", "12");
return map;
}
ab -n 50000 -c 1000 http://192.168.8.88:32800/system/test/map
the jar mode is
Concurrency Level: 1000
Time taken for tests: 8.472 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Total transferred: 11550000 bytes
HTML transferred: 1150000 bytes
Requests per second: 5901.51 [#/sec] (mean)
Time per request: 169.448 [ms] (mean)
Time per request: 0.169 [ms] (mean, across all concurrent requests)
Transfer rate: 1331.30 [Kbytes/sec] received
the native mode is
Concurrency Level: 1000
Time taken for tests: 12.721 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Total transferred: 11550000 bytes
HTML transferred: 1150000 bytes
Requests per second: 3930.37 [#/sec] (mean)
Time per request: 254.429 [ms] (mean)
Time per request: 0.254 [ms] (mean, across all concurrent requests)
Transfer rate: 886.64 [Kbytes/sec] received
oh,my god,native mode is slow,only boot quick?
Comment From: wilkinsona
This is in line with the expected performance of GraalVM native images. They generally start much faster and consume less memory but may have lower peak performance. Performance is an area of focus for the GraalVM team and it's improving with each release. You'll also see better performance with GraalVM enterprise edition as shown in this blog post.