My Kotlin playground:
- new kotlin version
- Gradle Kts
- kotest
- ๐บ
WeakHashMap:ConcurrentModificationExceptionandGC - ๐บ
WeakHashMap: the copy overhead ofWeakHashMap - ๐บ the queue time of tasks in
ThreadPoolExecutor - ๐บ
AhoCorasickDoubleArrayTrieperformance demo
when WeakHashMap key is gced in the WeakHashMap iteration,
WeakHashMap iteration will throw ConcurrentModificationException?
Demo Result: NO.
Demo code: WeakHashMapGcIteration
./gradlew execTestMain -P mainClass=playground.weakhashmap.WeakHashMapGcIterationKtDemo Result: copy ~30M items per second.
test on my MacBookPro16(Intel Core i9).
Demo code: WeakHashMapCopyOverheadDemo
./gradlew execTestMain -P mainClass=playground.weakhashmap.WeakHashMapCopyOverheadDemoKtResult:
average queue time = queue size / maximumPoolSize * average task execution time
Demo code: TaskQueueTimeThreadPoolExecutorDemo
./gradlew execTestMain -P mainClass=playground.threadpool.TaskQueueTimeThreadPoolExecutorDemoKtAhoCorasickDoubleArrayTrie performance simple demo.
Result: hit search ~O(1) to the size of search dictionary.
Demo code: AhoCorasickDoubleArrayTrieDemo
./gradlew execTestMain -P mainClass=playground.text.AhoCorasickDoubleArrayTrieDemoKt