@buck@formak If you're not already, you could compare Python 3.12:
"Dictionary, list, and set comprehensions are now inlined, rather than creating a new single-use function object for each execution of the comprehension. This speeds up execution of a comprehension by up to two times."