mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 06:29:23 +01:00
Refactors filters to utilize binary insertion instead of timSort (#93053)
## About The Pull Request update_filters() is more expensive than it should be due to running timSort every time a filter is added or removed, plus we wipe re-initialize the entire atom filter list every time we call it. I swapped it to use binary insertion into the main list, and we can cut down on the amount of filter churn by storing filters in a separate list which we can use Insert on, which allows us to stop constantly deleting and recreating filters completely. ## Why It's Good For The Game Server CPU consumption go down ## Changelog 🆑 refactor: Refactored filters to utilize binary insertion instead of timSort. The server should run somewhat faster now, hopefully. /🆑
This commit is contained in:
@@ -48,10 +48,7 @@
|
||||
pointed_atom_appearance.pixel_x = 0
|
||||
pointed_atom_appearance.pixel_y = 0
|
||||
thought_bubble.overlays += pointed_atom_appearance
|
||||
|
||||
var/hover_outline_index = pointed_atom.get_filter_index(HOVER_OUTLINE_FILTER)
|
||||
if (!isnull(hover_outline_index))
|
||||
pointed_atom_appearance.filters.Cut(hover_outline_index, hover_outline_index + 1)
|
||||
pointed_atom_appearance.remove_filter(HOVER_OUTLINE_FILTER)
|
||||
|
||||
thought_bubble.pixel_w = 16
|
||||
thought_bubble.pixel_z = 32
|
||||
|
||||
Reference in New Issue
Block a user