Skip to content

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.

@Liareth Liareth requested review from Daztek and mtijanic August 17, 2022 15:29
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