spring-templates / spring-concurrency-thread

Spring 프레임워크에서의 Thread 동시성 제어 문제를 다룹니다.
https://spring-templates.github.io/spring-concurrency-thread/
MIT License
0 stars 1 forks source link
concurrent-programming java multithreading spring-boot virtual-thread

codecov

Spring Boot Java Gradle JUnit5 JaCoCo Codecov GitHub Actions

관심사

정보

Counter-implementation Benchmark

  • median of 25 iterations
  • nRequests: 2^21 - 1
name nThreads time (ms) memory (KB)
AtomicBatch 4 12 480
Atomic 1 14 318
AtomicBatch 1 30 240
Lock 1 61 241
Synchronized 1 61 241
Polling 1 78 463
CompletableFuture 1 158 25710

AtomicBatch vs Atomic

  • nThreads: AtomicBatch=4, Atomic=1
name nRequests time (ms) memory (KB)
AtomicBatch 2^21 - 1 12 480
AtomicBatch 2^22 - 1 24 538
AtomicBatch 2^23 - 1 42 572
AtomicBatch 2^30 - 1 5695 511
AtomicBatch 2^31 - 1 11621 294
Atomic 2^21 - 1 14 318
Atomic 2^22 - 1 27 244
Atomic 2^23 - 1 55 344
Atomic 2^30 - 1 7178 103
Atomic 2^31 - 1 14377 266