Skip to content
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

Initial implementation of GetObjectByTag optimization, should help th… #1538

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

Conversation

Liareth
Copy link
Member

@Liareth Liareth commented Aug 17, 2022

…e LookupTable spikes too.

The main advantage here is that this PR heavily reduces time spikes spent when inserting or removing objects (e.g. creating or deleting any object with a tag). When the tag array grows large enough (Arelith is 200k+), inserting or removing tags near the start of the array cause the whole array to be shifted in either direction, which can lead to multiple second long spikes when done in a loop.

This change instead reduces that spike to objects that share a tag - perhaps still not ideal, but no longer disastrous. Based on the results I get from profiling this on Arelith, I may move to a more fine-grained approach like using chunks of object IDs so that the cost is fixed, or linked list, both of which would exchange lookup performance for insert/remove performance.

Untested beyond my toy module, but it seems to work. Side effect; Arelith module load time from 20s -> 5s. I'll convert from draft to real PR when I've tested it more.

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