You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
plistlib binary writer leaves large formats in the struct cache #161106
The binary plist writer builds its struct formats for the object references of every array and dict, and for the offset table, as one format code per item ('>' + code * n). The struct module caches compiled formats, and a format with one code per item compiles to about 33 bytes per item, so after plistlib.dumps() returns, memory proportional to the largest containers written stays allocated in the cache (up to 100 such formats).
The reader already uses repeat-count formats (f'>{n}{code}', gh-86269), which compile to a constant size; the writer should do the same. The output bytes are unchanged.
Activity
gh-161106: Use repeat counts in plistlib binary writer struct formats (…
[3.14] gh-161106: Use repeat counts in plistlib binary writer struct …
[3.15] gh-161106: Use repeat counts in plistlib binary writer struct …