openSUSE / libsolv

Library for solving packages and reading repositories
http://en.opensuse.org/openSUSE:Libzypp_satsolver
Other
509 stars 151 forks source link

updateinfoxml: workaround memory problem when adding to two flexarrays #533

Closed kontura closed 11 months ago

kontura commented 1 year ago

When directly adding packages and modules to both pd->handle and pd->collhandle flexarrays right after each other repodata_add_array has to constantly move data in data->attriddata. It wastes a lot of memory.

For example running updateinfoxml2solv on fedora 38 updates repo updateinfo uses ~30 MiB vs ~604 MiB (without patch) at usage peak.

vpodzime commented 1 year ago

Nice! :clap:

mlschroe commented 11 months ago

I would have preferred to fix the underlying problem with the add_array, by I don't see no easy way to do this. I did change your patch to just use one queue that stores both the type and the handle id.

Thanks a lot!