Closed codecat closed 1 month ago
I don't have the feeling that it does it always, the indicated code takes the MapInfo
Class and serializes it in Json::Value only once with ToJson()
, unless I forgot something...
tbf I don't see where it always serializes json
Every time this function is called, the json is serialized. I've seen a plugin call this function repeatedly every frame, which is obviously a large overhead.
That's of course also a problem in their plugin, but the API isn't explicitly saying that it's going to serialize anything, it's just called GetCurrentMapInfo
, which implies all it does it get something.
You have some trace logging left in the referenced commit which may be unexpected for API users. Thanks for the fix!
This could be improved for performance, by only serializing once and then returning the same
Json::Value@
.