[MDB IGNORE] Smoothing Bitfield Optimizations and Unit Test Upgrades (#4816)

<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
Presorting smoothing lists to improve init time.

## Credits
Mostly just taken from tgstation PRs, here's the major ones:
https://github.com/tgstation/tgstation/pull/57408
https://github.com/tgstation/tgstation/pull/71719
https://github.com/tgstation/tgstation/pull/71989
And of course my haphazard ports of TG code when something breaks.
This commit is contained in:
Zandario
2022-12-16 11:48:23 -08:00
committed by GitHub
parent d46ab1f578
commit cde2bdeb59
68 changed files with 1109 additions and 565 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
// Why? Because when you screw up too early in init, total runtimes won't be initialized. You can see why this can be a problem, right?
GLOBAL_REAL_VAR(total_runtimes) = 0
GLOBAL_VAR_INIT(total_runtimes_seen, 0)
GLOBAL_VAR_INIT(total_runtimes, GLOB.total_runtimes || 0)
GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
GLOBAL_VAR_INIT(total_runtimes_seen, 0)
// to detect when someone fucks up royally and breaks error handling with preinit runtimes
GLOBAL_REAL_VAR(runtime_skip_once) = FALSE
GLOBAL_REAL_VAR(runtime_trap_triggered) = FALSE
@@ -18,7 +18,7 @@ GLOBAL_REAL_VAR(runtime_trap_triggered) = FALSE
return
#endif
++global.total_runtimes
++GLOB.total_runtimes
var/static/list/error_last_seen = list()
var/static/list/error_cooldown = list() /* Error_cooldown items will either be positive(cooldown time) or negative(silenced error)