mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-21 04:57:57 +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:
@@ -74,8 +74,7 @@
|
||||
if("modify_icon_value")
|
||||
var/icon/new_icon = input("Pick icon:", "Icon") as null|icon
|
||||
if(new_icon)
|
||||
target.filter_data[params["name"]]["icon"] = new_icon
|
||||
target.update_filters()
|
||||
target.modify_filter(params["name"], list("icon" = new_icon))
|
||||
. = TRUE
|
||||
if("mass_apply")
|
||||
if(!check_rights_for(usr.client, R_FUN))
|
||||
|
||||
Reference in New Issue
Block a user