Dennis Sweeney <sweeney.dennis...@gmail.com> added the comment:
PR 20718 helps somewhat by only creating and hashing the tuples that wind up in the final set. Here's a benchmark: -m pyperf timeit -s "d1 = {i:i for i in range(100_000)}; d2 = {i:i|1 for i in range(100_000)}" "d1.items() ^ d2.items()" Master: 37.9 ms +- 0.4 ms PR 20718: 25.5 ms +- 0.4 ms ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue40889> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com