Preamble
This pairs with the 2019 Python data-structure benchmarks: asymptotics travel across languages; constants and growth strategies differ. I keep a bilingual mental map so reviews and designs do not reinvent vocabulary.
Mappings
HashMap and dict both target amortized O(1) expected lookups. When you need sorted keys maintained in the structure, Java offers TreeMap; Python often uses dict plus explicit sorted(keys)—not equivalent cost profiles, so choose consciously.
Sequences
ArrayList mirrors Python list: dynamic arrays, fast index access, amortized append. LinkedList rarely wins on modern CPUs due to cache locality—similar lessons to list vs deque in Python depending on access pattern (2019 stack post).
When to micro-benchmark
Carry complexity arguments across languages; burn bench time only when profilers point here—cProfile and py-spy: Two Ways to See Where Python Spends Time for Python, GC/logs for Java services.
Conclusion
Shared Big-O vocabulary speeds polyglot work. pytest Layout, Fixtures, and Parametrization structures pytest like benchmark harnesses: small, isolated, repeatable.