Sunday, March 16, 2025
1 change · master
Enhancements to existing features
This update improves an internal tool used to remove duplicate items, making it faster while keeping the same results. It should slightly improve performance in areas that rely on this shared utility without changing user-facing behavior.
Original PR description
Use `dict` instead of `set` in `unique` for performance. - Memory: The load factor for scaling up is 2/3 for `dict` and 3/5 for `set`, meaning `dict` does not always consume more memory than `set`. Also in our use cases, `unique` is never early stopped, so pre-generating the `dict` is not an issue. - Performance: `dict.fromkeys` assigns values in C, making it significantly faster than using `set.add` in Python. Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr