mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-12 10:42:37 +00:00
Closes #73902 > Since strings are ref counted, and a `\ref` creates a string, then in cases where a `\ref` is only intended to go to an html window showed to a player or admin, storing it would extend how long the string for the `\ref` exists in the string tree, which is likely bloating the string tree and making it have to force a rebalance more often. > > 515's next version has a pretty decent speedup on `\ref`/`ref()`. Turned into an experiment flag for a few reasons: 1. I like the idea of when testing 515, only testing 515, and not our changes that benefit from 515 2. Lets me profile the differences a lot easier 3. Makes it clearer what needs to be removed, since I have locked `cached_ref` behind *not* having the flag. Also adds a compile error if these flags live past 515.
35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
// This file contains experimental flags that may not be production ready yet,
|
|
// but that we want to be able to easily flip as well as run on CI.
|
|
// Any flag you see here can be flipped with the `-D` CLI argument.
|
|
// For example, if you want to enable EXPERIMENT_MY_COOL_FEATURE, compile with -DEXPERIMENT_MY_COOL_FEATURE
|
|
|
|
// EXPERIMENT_515_QDEL_HARD_REFERENCE
|
|
// - Hold a hard reference for qdeleted items, and check ref_count, rather than using refs. Requires 515+.
|
|
|
|
// EXPERIMENT_515_DONT_CACHE_REF
|
|
// - Avoids `text_ref` caching, aided by improvements to ref() speed in 515.
|
|
|
|
#if DM_VERSION < 515
|
|
|
|
// You can't X-macro custom names :(
|
|
#ifdef EXPERIMENT_515_QDEL_HARD_REFERENCE
|
|
#warn EXPERIMENT_515_QDEL_HARD_REFERENCE is only available on 515+
|
|
#undef EXPERIMENT_515_QDEL_HARD_REFERENCE
|
|
#endif
|
|
|
|
#ifdef EXPERIMENT_515_DONT_CACHE_REF
|
|
#warn EXPERIMENT_515_DONT_CACHE_REF is only available on 515+
|
|
#undef EXPERIMENT_515_DONT_CACHE_REF
|
|
#endif
|
|
|
|
#elif defined(UNIT_TESTS)
|
|
|
|
#define EXPERIMENT_515_QDEL_HARD_REFERENCE
|
|
#define EXPERIMENT_515_DONT_CACHE_REF
|
|
|
|
#endif
|
|
|
|
#if DM_VERSION >= 516
|
|
#error "Remove all 515 experiments"
|
|
#endif
|