The Catechism of java.lang.String
summary
A talk about performance and memory issues when working with java.lang.String in Java applications, focusing on common problems like expensive concatenation, inefficient substring handling, excessive use of string interning, and pitfalls of deduplication. It also examines misplaced expectations developers may have of the JDK and JVM and how string-related optimizations can immediately reduce memory use and avoid OutOfMemoryError.
AI-written summary · about
chapters (20)
- 0:00String catechism intro
- 2:41Why Strings matter
- 5:54String memory overhead
- 8:21String concat performance
- 10:49String immutability trade-offs
- 13:00Integer to String myths
- 16:33Lazy logging overhead
- 19:21String hashCode impl
- 22:11HashMap collision risks
- 26:07Worry about hashCode collisions?
- 28:02String substring changes
- 31:25String intern vs duplication
- 34:01String deduplication in practice
- 37:34String deduplication features
- 40:07String intern myths
- 41:54String equals performance
- 46:37String splitting and regex
- 48:50CharArray vs String iteration
- 51:03String search methods
- 54:14Summary
