mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 11:48:37 +00:00
[Strings] Split String Optimizations (#1325)
* Switch the 2 split calls to SplitString * Nuke duplicate split in favor of SplitString #1263 * Add a test for SplitString * Optimize SplitString Benchmarking: -------------------------------------------------------------- Benchmark Time CPU Iterations -------------------------------------------------------------- bench_oldsplit 5201 ns 5201 ns 129500 bench_split 1269 ns 1269 ns 548906 This is splitting a VERY long SpecialAbilities string. This is ~75% speed up.
This commit is contained in:
committed by
GitHub
parent
00fb9bc9f9
commit
dba3010c89
@@ -93,7 +93,7 @@ void ZoneEventScheduler::Process(Zone *zone, WorldContentService *content_servic
|
||||
}
|
||||
|
||||
if (e.event_type == ServerEvents::EVENT_TYPE_RULE_CHANGE) {
|
||||
auto params = split(e.event_data, '=');
|
||||
auto params = SplitString(e.event_data, '=');
|
||||
auto rule_key = params[0];
|
||||
auto rule_value = params[1];
|
||||
if (!rule_key.empty() && !rule_value.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user