Tagged articles
3 articles
Page 1 of 1
BirdNest Tech Talk
BirdNest Tech Talk
Oct 4, 2024 · Fundamentals

How Go’s New unique Package Enables Efficient Interning and Memory Savings

Go 1.23 introduces the unique package, which provides generic interning for comparable values, allowing canonicalization of strings and structs, reducing memory usage and speeding up equality checks; the article walks through a simple map‑based implementation, its limitations, the advanced Handle[T] design, real‑world netip usage, and future prospects.

Garbage CollectionMemory Optimizationcanonicalization
0 likes · 10 min read
How Go’s New unique Package Enables Efficient Interning and Memory Savings
Python Programming Learning Circle
Python Programming Learning Circle
Jun 4, 2021 · Fundamentals

WTF Python: Unexpected Behaviors and Intriguing Edge‑Case Examples

This article presents a curated collection of surprising Python examples that reveal counter‑intuitive behaviors such as string interning, dictionary key collisions, loop variable scope, generator evaluation timing, the difference between 'is' and '==', and closure capture, providing detailed explanations and code demonstrations for each case.

LanguageTutorialedge cases
0 likes · 16 min read
WTF Python: Unexpected Behaviors and Intriguing Edge‑Case Examples
Programmer DD
Programmer DD
Sep 11, 2019 · Fundamentals

Why Java Strings Are Final and How Interning Affects Memory

This article explains the two ways to create Java strings, demonstrates how string literals are shared in the method area, shows the effect of the intern() method at runtime, and discusses why the String class is final, immutable, and thread‑safe.

Memory ManagementStringfinal
0 likes · 8 min read
Why Java Strings Are Final and How Interning Affects Memory