High performance Scala systems without tears
summary
Shows concrete wins: replacing Option-based extractors with name-based extractors removes per-match Some allocations (heap snapshot shows no Some objects), reduces GC work and raises throughput versus the Option baseline (baseline example ~13M ops/s for a synchronized variant). Uses SBT JMH, Java Object Layout and Intel VTune/pcm to measure L2 misses and IPC. Replaces locks with atomics and lazySet to cut fences, pads fields to avoid false sharing, and deploys an affinity pool in Akka to improve cache locality.
AI-written summary · about
chapters (18)
- 0:00Start
- 1:42Excessive Object Instantiation
- 2:08Non Determinism
- 6:43Bytecode
- 8:51Heap Histogram
- 11:09Memory Access Patterns
- 13:16The Matrix Transposition Problem
- 19:56Cache Oblivious Algorithms
- 22:21Synchronization
- 31:42False Sharing
- 36:04Explicit Padding
- 36:36Concurrent Libraries
- 39:08Use Case
- 39:21Message Lifecycle
- 40:23Limitations
- 41:40Affinity Pool
- 42:31Fair Distribution Cue Selector
- 43:00What Are the Advantages
related talks
23mThe Future of Scala Performance on Big Data
54mHow Not to Write Slow Scala
48mMassively Parallel Distributed Scala Compilation And You
21mReasonable Scala Compiler
49mNumbers every Scala programmer should know
45mScala and the JVM as a Big Data Platform Lessons from Apache Spark
01h 02mSimply Scala
42mWhat Scala can learn from Rust, Swift, and C++
