mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Merge remote-tracking branch 'origin/topic/timw/595-json-perf'
* origin/topic/timw/595-json-perf: Update COPYING.3rdparty Use json::emplace to avoid some extra calls to operator[] Use tessil/unordered-map instead of nlohmann/fifo-map to mitigate performance issues when logging JSON
This commit is contained in:
commit
a5d71ed2d2
11 changed files with 55 additions and 32 deletions
|
@ -37,7 +37,7 @@ bool JSON::Describe(ODesc* desc, int num_fields, const Field* const * fields,
|
|||
if ( new_entry.is_null() )
|
||||
return false;
|
||||
|
||||
j[fields[i]->name] = new_entry;
|
||||
j.emplace(fields[i]->name, new_entry);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -186,11 +186,7 @@ ZeekJson JSON::BuildJSON(Value* val, const string& name) const
|
|||
}
|
||||
|
||||
if ( ! name.empty() && ! j.is_null() )
|
||||
{
|
||||
ZeekJson j2 = ZeekJson::object();
|
||||
j2[name] = j;
|
||||
return j2;
|
||||
}
|
||||
return { { name, j } };
|
||||
|
||||
return j;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue