Tagged articles
keySet
15 articles · Page 1 of 1
This article compares four pagination strategies—standard LIMIT/OFFSET, primary‑key filtering, has‑more scrolling, and Elasticsearch pagination—explaining their trade‑offs, performance impacts, and suitable use cases while providing concrete SQL and Java code examples.
BackendMySQLkeySet
0 likes · 6 min read

This article explains why Redisson's RMapCache.size() includes expired entries, demonstrates how to obtain the exact number of currently valid key‑value pairs using keySet().size() or readAllEntrySet().size(), and provides performance tips and a real‑world e‑commerce use case.
Cache MonitoringJavaRMapCache
0 likes · 10 min read

A backend team discovered that their simple paginated API slowed from 200 ms to over 2 seconds as data grew, traced the issue to costly OFFSET scans, and solved it by switching to keyset (cursor) pagination, adding proper indexes and a materialized view, achieving sub‑200 ms response times.
OFFSETPaginationkeySet
0 likes · 7 min read

This article examines Java HashMap traversal techniques, compares keySet, entrySet, iterator and stream approaches, explains why keySet appears to iterate twice by revealing its internal iterator implementation, and presents code examples and decompiled snippets to illustrate the underlying mechanisms.
HashMapJavacollections
0 likes · 8 min read

This article explains the internal mechanism of HashMap traversal in Java, detailing how keySet() leads to two iteration steps via an iterator, while entrySet() and Map.forEach() provide a single-pass iteration, and examines the underlying iterator classes and their constructors.
HashMapJavacollections
0 likes · 8 min read

This article explains the various ways to traverse a Java HashMap, compares keySet and entrySet approaches, shows why keySet involves two passes, and demonstrates the underlying iterator implementation with detailed code examples and decompiled snippets.
HashMapJavaentrySet
0 likes · 8 min read

This article explains the internal mechanism of Java's HashMap traversal, showing that using keySet() triggers two passes—once to create an iterator and once to fetch values—while entrySet() or Map.forEach() can iterate in a single pass, and it walks through the relevant source code to illustrate the process.
HashMapJavaentrySet
0 likes · 9 min read

This article explains why iterating a Java HashMap with keySet() involves two passes, examines the underlying iterator implementation, and walks through the relevant source code of HashMap’s KeySet, KeyIterator, and HashIterator classes to clarify the internal traversal mechanism.
HashMapJavaiteration
0 likes · 8 min read

This article explains the internal mechanics of HashMap traversal in Java, comparing iterator, keySet, entrySet and stream approaches, and reveals why using keySet results in two passes—once to obtain an iterator and once to fetch values—by examining the underlying KeySet, KeyIterator, and HashIterator implementations.
HashMapJavaiterator
0 likes · 8 min read

This article explains why iterating a Java HashMap with keySet() results in two traversals, detailing the internal iterator creation, the role of KeyIterator and HashIterator classes, and how the do‑while loop in HashIterator’s constructor locates the first entry, with code examples and bytecode analysis.
HashIteratorHashMapJava
0 likes · 9 min read

This article explains why iterating a Java HashMap via keySet() incurs two passes—once to obtain an iterator and again to fetch values—while entrySet() or Map.forEach() performs a single pass, detailing the underlying iterator implementations and their bytecode behavior.
JavaentrySetfor-each
0 likes · 9 min read

This article explains the internal mechanics of Java's HashMap traversal, showing that keySet() incurs two passes due to iterator creation while entrySet() (or Map.forEach) iterates in a single pass, and it demonstrates the process through decompiled source code and concrete examples.
JavaentrySetiteration
0 likes · 8 min read

This article explains the internal mechanics of HashMap traversal in Java, showing that keySet() uses an iterator that iterates twice to locate entries, whereas entrySet() (or Map.forEach) iterates only once, and it walks through the relevant source code and decompiled bytecode to illustrate the process.
HashMapJavaJava8
0 likes · 8 min read

This article demonstrates four practical ways to iterate over a Java HashMap—including enhanced for loops with keySet(), iterator-based loops with keySet(), enhanced for loops with entrySet(), and iterator-based loops with entrySet()—and provides a complete example that filters employee objects by salary, complete with full source code.
BackendHashMapcollections
0 likes · 10 min read

This tutorial explains five different techniques for traversing Java Map collections—including keySet, entrySet, for‑each loops, and lambda forEach—provides complete code examples for each method, shows the resulting output, and offers performance recommendations.
HashMapJavaentrySet
0 likes · 7 min read
