~/talk

Case classes ate my RAM

Talkat Scala.IO 2017 · 2017-11-02..11-03· [web-performance]
slides:none on file

Case-class-heavy Scala heaps turn out to store tiny payloads and huge object overhead: a four-char String + long case class lands around ~72 bytes while naïve lists converge to ~96 bytes per element; packing cuts that to ~19–31 bytes per element in benchmarks. The author uses JOL and a Java agent to measure, Shapeless-based derivation to serialize case classes into Array[Byte], and implements scala-packed packed collections (immutable arrays and open-addressing maps). Memory drops by an order of magnitude at the cost of some CPU slowdown; prototype works but remains under further testing before production use.

AI-written summary · about

  1. 0:00Introduction
  2. 1:34Memory challenges with user data
  3. 2:15Case classes memory costs
  4. 5:11JOL memory layout analysis
  5. 7:18Case classes in collections impact
  6. 8:25JAMM memory usage measurement
  7. 9:52C++ versus JVM memory
  8. 11:20Can JVM match C++?
  9. 12:04Project Valhalla exploration
  10. 13:53JVM optimization limits
  11. 14:16Scallop Act introduction
  12. 15:00Scallop Act code demo
  13. 18:45Shapeless serialization
  14. 21:17Custom collections integration
  15. 27:48Packed collections memory layout
  16. 30:40Packed maps implementation
  17. 32:44Packed collections trade-offs
  18. 35:11Performance benchmarks
  19. 39:05Production use and plans
  20. 40:30Resources and tools
  21. 41:22Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.