Skip to content

Add selective collect to memory allocations #10264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Apr 16, 2025

By selectively collecting an allocation, we can skip scanning many allocations for pointers because we know up front they won't have them. This helps a ton when large buffers are being used and memory is slow (PSRAM). In one Fruit Jam example GC times drop from 80+ms to ~25ms. The example uses a number of bitmaps that are now no longer scanned.

@tannewt
Copy link
Member Author

tannewt commented Apr 17, 2025

I have this branch with debugging prints and checks: https://github.com/tannewt/circuitpython/tree/debug_gc_selective_collect

@tannewt
Copy link
Member Author

tannewt commented Apr 17, 2025

Hopefully #10269 will make enough space for this.

By selectively collecting an allocation, we can skip scanning many
allocations for pointers because we know up front they won't have
them. This helps a ton when large buffers are being used and memory is
slow (PSRAM). In one Fruit Jam example GC times drop from 80+ms to
~25ms. The example uses a number of bitmaps that are now no longer
scanned.
@tannewt tannewt force-pushed the gc_selective_collect branch from 69e4bcd to c340596 Compare April 22, 2025 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant