HelloKt 😸, my kotlin playground 🎡
My Kotlin playground:
WeakHashMap
: ConcurrentModificationException
and GC
WeakHashMap
: the copy overhead of WeakHashMap
ThreadPoolExecutor
AhoCorasickDoubleArrayTrie
performance demoWeakHashMap
: ConcurrentModificationException
and GC
when WeakHashMap
key is gc
ed in the WeakHashMap
iteration,
WeakHashMap
iteration will throw ConcurrentModificationException
?
Demo Result: NO.
Demo code: WeakHashMapGcIteration
./gradlew execTestMain -P mainClass=playground.weakhashmap.WeakHashMapGcIterationKt
WeakHashMap
: the copy overhead of WeakHashMap
Demo Result: copy ~30M items per second. test on my MacBookPro16(Intel Core i9).
Demo code: WeakHashMapCopyOverheadDemo
./gradlew execTestMain -P mainClass=playground.weakhashmap.WeakHashMapCopyOverheadDemoKt
ThreadPoolExecutor
Result:
average queue time = queue size / maximumPoolSize * average task execution time
Demo code: TaskQueueTimeThreadPoolExecutorDemo
./gradlew execTestMain -P mainClass=playground.threadpool.TaskQueueTimeThreadPoolExecutorDemoKt
AhoCorasickDoubleArrayTrie
performance demoAhoCorasickDoubleArrayTrie
performance simple demo.
Result: hit search ~O(1) to the size of search dictionary.
Demo code: AhoCorasickDoubleArrayTrieDemo
./gradlew execTestMain -P mainClass=playground.text.AhoCorasickDoubleArrayTrieDemoKt