Skip to content

Conversation

@ibraheemdev
Copy link
Member

@ibraheemdev ibraheemdev commented Aug 5, 2025

Summary

Use a global tracker to avoid double counting Arc instances.

@ibraheemdev ibraheemdev added the internal An internal refactor or improvement label Aug 5, 2025
@ibraheemdev ibraheemdev added the ty Multi-file analysis & type inference label Aug 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2025

Diagnostic diff on typing conformance tests

No changes detected when running ty on typing conformance tests ✅

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2025

mypy_primer results

No ecosystem changes detected ✅

Memory usage changes were detected when running on open source projects
flake8 (https://github.com/pycqa/flake8)
- TOTAL MEMORY USAGE: ~66MB
+ TOTAL MEMORY USAGE: ~69MB
-     memo fields = ~52MB
+     memo fields = ~54MB

trio (https://github.com/python-trio/trio)
- TOTAL MEMORY USAGE: ~159MB
+ TOTAL MEMORY USAGE: ~167MB
-     memo fields = ~119MB
+     memo fields = ~125MB

sphinx (https://github.com/sphinx-doc/sphinx)
-     memo fields = ~204MB
+     memo fields = ~214MB

prefect (https://github.com/PrefectHQ/prefect)
-     memo fields = ~424MB
+     memo fields = ~445MB

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@ibraheemdev ibraheemdev force-pushed the ibraheem/get-size-tracker branch from f72569d to 898c4c3 Compare August 5, 2025 21:51
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Would it be worth considering to vendor our own get_size (in ruff memory usage). It's not very complicated code.

salsa-rs/salsa#944 would allow us to avoid the global lock.

@AlexWaygood AlexWaygood removed their request for review August 6, 2025 07:17
@ibraheemdev ibraheemdev force-pushed the ibraheem/get-size-tracker branch 2 times, most recently from d8cc48f to f279122 Compare August 6, 2025 18:06
@ibraheemdev ibraheemdev force-pushed the ibraheem/get-size-tracker branch from f279122 to aa1c34a Compare August 6, 2025 18:12
@ibraheemdev ibraheemdev force-pushed the ibraheem/get-size-tracker branch from aa1c34a to ee45cc6 Compare August 6, 2025 18:17
@ibraheemdev
Copy link
Member Author

It looks like untracked_arc_size was incorrect before in that it didn't account for the stack size of T, so the reported memory usage correctly goes up with this change.

@ibraheemdev ibraheemdev merged commit 21ac16d into main Aug 6, 2025
38 checks passed
@ibraheemdev ibraheemdev deleted the ibraheem/get-size-tracker branch August 6, 2025 19:32
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 ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants