Tagged articles
string interning
10 articles · Page 1 of 1
This article explains the three Java constant pools—class file, runtime, and string—detailing their evolution from compilation to execution, their memory locations across JDK versions, how string literals are interned, code examples illustrating their behavior, common misconceptions, and typical interview follow‑up questions.
Constant PoolInterviewJVM
0 likes · 15 min read

The article explains string interning as a memory‑saving technique, shows how to implement it manually in Go, compares the go4.org/intern library with the standard‑library unique package, and presents benchmark results that reveal memory savings but a modest speed trade‑off.
Concurrencybenchmarkgolang
0 likes · 15 min read

The article shows how to diagnose and dramatically cut Python’s memory usage by using built‑in tools such as sys.getsizeof, psutil, __slots__, generator expressions, memory‑mapped files (mmap) and string interning, providing concrete code examples, benchmarks and practical tips to avoid common pitfalls.
Python__slots__generator
0 likes · 15 min read

The article explains how Rust’s ustr library implements string interning to store each unique string only once, offering O(1) pointer‑based comparison, pre‑computed hashing, zero‑cost cloning, seamless C FFI, and thread‑safe usage, while also detailing its internal design, usage patterns, suitable scenarios, and trade‑offs.
FFIRustperformance
0 likes · 14 min read

This article explains Java’s constant pools, detailing the class constant pool stored in .class files, its transformation into the runtime constant pool during JVM loading, and the specialized string constant pool that optimizes memory usage, including recent changes moving it to heap memory.
Constant PoolJVMJava
0 likes · 3 min read

This article explains how Java’s compiler applies constant folding to compile‑time constants, turning string concatenations like "a"+"b"+"c" into a single String object, distinguishes compile‑time versus runtime constants, and demonstrates the impact on the constant pool and equality comparisons.
Compile-time ConstantsJVMJava
0 likes · 9 min read

This article explores a collection of surprising Python quirks—including string interning, the difference between is and ==, function return semantics, for‑loop variable handling, triple‑quoted strings, and in‑place operators—illustrating why even experienced developers encounter hidden pitfalls during everyday coding.
Pythonfundamentalspitfalls
0 likes · 8 min read

This article explains why identical integers and short strings may reference the same object in Python, how the small‑integer cache and string interning work, and how compilation units and constant pools affect object identity across interactive sessions and script files.
Compilation UnitConstant PoolInteger caching
0 likes · 8 min read

This article explains the differences between Java's heap and stack memory areas, their advantages and disadvantages, and demonstrates how string objects are allocated and shared with clear code examples that illustrate memory usage and performance implications.
HeapJavagarbage collection
0 likes · 4 min read

This article explains the Java constant pool, distinguishing static and runtime pools, demonstrates string interning behavior with code examples, and shows how to inspect class files and memory settings to observe constant pool effects in the JVM.
Constant PoolJVMmemory management
0 likes · 9 min read
