mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-27 11:53:41 +00:00
Fix lag on OOS with AIs
Following 9fc6c3c897, the OOS debugSerializer would try to serialize AI
objects entirely. This is extremely slow (might be an infinite loop in
some cases).
Instead, it should print the result of Serialize() in those cases.
(The original idea was that it would print more debugging information,
but in practice it seems to mostly print things that show up when
diffing but aren't actually sources of OOS, so essentially garbage).
Fixes #5917
Differential Revision: https://code.wildfiregames.com/D3361
This was SVN commit r24641.
This commit is contained in:
@@ -154,12 +154,11 @@ void CDebugSerializer::PutScriptVal(const char* name, JS::MutableHandleValue val
|
||||
JS::RootedValue serialize(rq.cx);
|
||||
if (m_ScriptInterface.GetProperty(value, "Serialize", &serialize) && !serialize.isNullOrUndefined())
|
||||
{
|
||||
// If the value has a Serialize property, pretty-parse that and return the value as a raw string.
|
||||
// This gives more debug data for components in case of OOS.
|
||||
// If the value has a Serialize property, pretty-parse that instead.
|
||||
// (this gives more accurate OOS reports).
|
||||
m_ScriptInterface.CallFunction(value, "Serialize", &serialize);
|
||||
std::string serialized_source = m_ScriptInterface.ToString(&serialize, true);
|
||||
std::string source = m_ScriptInterface.ToString(value, false);
|
||||
m_Stream << INDENT << name << ": " << serialized_source << " (raw: " << source << ")\n";
|
||||
m_Stream << INDENT << name << ": " << serialized_source << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user