Python sets and dictionaries can have quadratic-time performance
ibobev
12 points
2 comments
September 08, 2026
Related Discussions
Found 5 related stories in 122.7ms across 10,409 title embeddings via pgvector HNSW
- 6× faster binary search: from compiled code to mechanical sympathy enz · 15 pts · July 12, 2026 · 47% similar
- Parsing JSON at gigabytes per second in Python smilelamp · 18 pts · October 12, 2026 · 42% similar
- How Fast is Python 3.15? Qem · 55 pts · October 06, 2026 · 42% similar
- Static search trees: 40x faster than binary search (2024) lalitmaganti · 82 pts · July 17, 2026 · 39% similar
- Python Polars Cheatsheet (based on our O'Reilly book) jeroenjanssens · 169 pts · August 18, 2026 · 39% similar
Discussion Highlights (2 comments)
0xa2
The map is not the territory.
javcasas
Java's HashMap also has O(log(N)) complexity on hash collision, and that is before memory/cache details. https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.... In fact, some studying on data structures probably leads to the conclusion that it is impossible to guarantee that an unbounded set/map to have access performance under O(log(N)).