-
Notifications
You must be signed in to change notification settings - Fork 276
Excessive runtime for nested OrderedDict instances #3123
Copy link
Copy link
Closed
astral-sh/ruff
#24219Labels
fuzzerIssues surfaced by fuzzing tyIssues surfaced by fuzzing typerformancePotential performance improvementPotential performance improvement
Milestone
Description
Summary
I found this to be slow when type checking:
from collections import OrderedDict
OrderedDict(OrderedDict(OrderedDict(OrderedDict(OrderedDict(OrderedDict(("one", 1)))))))
This takes about 11 seconds on my machine.
The example was found using a fuzzer.
While this example is not a real program someone would write, I'm submitting it in case the root cause can slow down ty in other situations that are useful. Feel free to close if it's unrelated.
Version
0.15.7+22 (dd6d84305 2026-03-21)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
fuzzerIssues surfaced by fuzzing tyIssues surfaced by fuzzing typerformancePotential performance improvementPotential performance improvement