From: Anton Ivanov <[email protected]>
A JSON object sort order is by definition arbitrary. OVS
parser(s) do not care about object order - the result is
loaded into a SHASH losing any order on the wire.
Having the objects sorted is a performance penalty, especially
for large objects like f.e. lflow state. That is represented
as {"table_name":{"uuid":data, "uuid":data, "uuid":data}}
Sorting in a case like this has no meaning neither to human,
nor to computer. If, however, there are 0.5M such records, it
is a subtantial CPU (and latency) penalty.
Signed-off-by: Anton Ivanov <[email protected]>
---
lib/jsonrpc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c
index c8ce5362e..3b44f73fe 100644
--- a/lib/jsonrpc.c
+++ b/lib/jsonrpc.c
@@ -802,7 +802,7 @@ jsonrpc_msg_to_string(const struct jsonrpc_msg *m)
{
struct jsonrpc_msg *copy = jsonrpc_msg_clone(m);
struct json *json = jsonrpc_msg_to_json(copy);
- char *s = json_to_string(json, JSSF_SORT);
+ char *s = json_to_string(json, 0);
json_destroy(json);
return s;
}
--
2.20.1
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev