JVM Performance
- Profile first. JVM profilers read Scala natively: flame graphs name your lambdas and pipelines.
- Collection costs. Chained transforms allocate intermediates: views or single folds where measurement says so.
- Benchmarking. JMH benchmarks Scala honestly: warmup, forks, statistics: or the JIT writes fiction.
Functional Allocation Trade-Offs
- Immutability costs. Persistent structures allocate: usually fine, measured when hot.
- Specialisation. Hot numeric code avoids boxing: arrays and while loops allowed where profiled.
- The pragmatic core. Idiomatic Scala is pure at the design level and pragmatic in proven hot loops: documented exceptions.
Production Scala Design
- Config and logging. Typed configuration and structured logging: production Scala observable like any JVM service.
- Graceful shutdown. Services release resources through bracket/Resource patterns: shutdown as a composed effect.
- Boring where it counts. Production Scala keeps the boring virtues: pinned versions, small dependencies, one idiom per problem.
Before and after this level
- Before: Level 11: Build & Testing: SBT, Testing, Package and Module Design.
- Next: Level 13: Scala Mastery: Advanced Types, Functional Architecture, Reading and Improving Complex Scala.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does Scala Level 12: Performance & Production cover?
JVM Performance, Functional Allocation Trade-Offs, Production Scala Design: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 11: Build & Testing, which covers SBT, Testing, Package and Module Design.