Skip to content

Comments

[ty] Add caching to CodeGeneratorKind::matches()#19901

Closed
AlexWaygood wants to merge 1 commit intoalex/namedtuple-propertiesfrom
alex/optimize-codegenerator
Closed

[ty] Add caching to CodeGeneratorKind::matches()#19901
AlexWaygood wants to merge 1 commit intoalex/namedtuple-propertiesfrom
alex/optimize-codegenerator

Conversation

@AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Aug 13, 2025

Summary

Stacked on top of #19899.

There are some small performance regressions in the Codspeed report for #19899 -- this appears to mitigate that!

Test Plan

Existing tests

@AlexWaygood AlexWaygood added performance Potential performance improvement ty Multi-file analysis & type inference labels Aug 13, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 13, 2025

Diagnostic diff on typing conformance tests

Changes were detected when running ty on typing conformance tests
--- old-output.txt	2025-08-13 21:44:24.067127850 +0000
+++ new-output.txt	2025-08-13 21:44:24.137128742 +0000
@@ -1,5 +1,5 @@
 WARN ty is pre-release software and not ready for production use. Expect to encounter bugs, missing features, and fatal errors.
-fatal[panic] Panicked at /home/runner/.cargo/git/checkouts/salsa-e6f3bb7c2a062968/918d35d/src/function/execute.rs:215:25 when checking `/home/runner/work/ruff/ruff/typing/conformance/tests/aliases_typealiastype.py`: `infer_definition_types(Id(4c9d)): execute: too many cycle iterations`
+fatal[panic] Panicked at /home/runner/.cargo/git/checkouts/salsa-e6f3bb7c2a062968/918d35d/src/function/execute.rs:215:25 when checking `/home/runner/work/ruff/ruff/typing/conformance/tests/aliases_typealiastype.py`: `infer_definition_types(Id(acd1)): execute: too many cycle iterations`
 _directives_deprecated_library.py:15:31: error[invalid-return-type] Function always implicitly returns `None`, which is not assignable to return type `int`
 _directives_deprecated_library.py:30:26: error[invalid-return-type] Function always implicitly returns `None`, which is not assignable to return type `str`
 _directives_deprecated_library.py:36:41: error[invalid-return-type] Function always implicitly returns `None`, which is not assignable to return type `Self@__add__`

@github-actions
Copy link
Contributor

github-actions bot commented Aug 13, 2025

mypy_primer results

No ecosystem changes detected ✅
No memory usage changes detected ✅

@AlexWaygood AlexWaygood force-pushed the alex/optimize-codegenerator branch from 8a953bc to cccdaff Compare August 13, 2025 17:24
@AlexWaygood AlexWaygood marked this pull request as ready for review August 13, 2025 17:36
@AlexWaygood AlexWaygood added the internal An internal refactor or improvement label Aug 13, 2025
@AlexWaygood AlexWaygood force-pushed the alex/namedtuple-properties branch from be3e7a2 to 9a70798 Compare August 13, 2025 21:41
@AlexWaygood AlexWaygood force-pushed the alex/optimize-codegenerator branch from cccdaff to 8253fce Compare August 13, 2025 21:42
Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were cycles observed here, or are you adding the cycle handling pre-emptively?

@AlexWaygood
Copy link
Member Author

@AlexWaygood
Copy link
Member Author

I split this out as a standalone change in #19912

@AlexWaygood AlexWaygood deleted the alex/optimize-codegenerator branch August 14, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement performance Potential performance improvement ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants