A rapified config.bin is slower to fetch from ingame than a plain text config.cpp that is otherwise identical.
I am told that once a config is loaded on game start, the format it came in (.bin or .cpp) is irrelevant, so the results in this post should be impossible.
Testing method:
I created a config class with 25000 identical sub classes to iterate through.
class sub_class_0 { string="This is a repro config to demonstrate slower config fetch times when the config is loaded from a rapified state, compared to plain text."; number=0; array[]= { "string", 1, {} }; };
I loaded this config in two separate pbos, one using a plain text config.cpp, the other using a rapified config.bin.
The config.cpp class was called Repro_FastCppCfg, the config.bin class was called Repro_SlowBinCfg.
I tested two methods of iterating through the config classes, here are the results.
foreach + configclasses
// Repro_FastCppCfg: [68.6,15] diag_codePerformance[{ { getText(_x >> "string"); getNumber(_x >> "number"); getArray(_x >> "array"); } forEach ("true" configClasses (configFile >> "Repro_FastCppCfg")); }];
// Repro_SlowBinCfg: [18126,1] diag_codePerformance[{ { getText(_x >> "string"); getNumber(_x >> "number"); getArray(_x >> "array"); } forEach ("true" configClasses (configFile >> "Repro_SlowBinCfg")); }];
for + select
// Repro_FastCppCfg: [75.4286,14] diag_codePerformance[{ private _cfg = configFile >> "Repro_FastCppCfg"; for "_i" from 0 to (count _cfg) - 1 do { getText(_cfg select _i >> "string"); getNumber(_cfg select _i >> "number"); getArray(_cfg select _i >> "array"); }; }];
// Repro_SlowBinCfg: [42910,1] diag_codePerformance[{ private _cfg = configFile >> "Repro_SlowBinCfg"; for "_i" from 0 to (count _cfg) - 1 do { getText(_cfg select _i >> "string"); getNumber(_cfg select _i >> "number"); getArray(_cfg select _i >> "array"); }; }];
As demonstrated, despite their contents being identical, the Repro_SlowBinCfg config loaded from a rapified config.bin is much slower to fetch from than the Repro_FastCppCfg plain text config.cpp counterpart.