Skip to content

Use JSON to improve efficiency

Walter Lozano requested to merge wip/wlozano/json into master

YAML is a nice format, very easy to read, unfortunately the Python YAML library is very inefficient both CPU and memory wise. Loading the same content using JSON takes 10 times less memory and time.

Since dashboard is always struggling with OOM, let's use JSON for the data it produces.

As reference, below results of importing a 10 MB file with YAML and JSON are presented

yaml-json $ ./test.py yaml
Time 15.507138013839722 seg
Memory (70914086, 394044198) bytes (current, peak)

yaml-json $ ./test.py json
Time 0.6210496425628662 seg
Memory (58913059, 67501787) bytes (current, peak)

https://phabricator.apertis.org/T10163

Signed-off-by: Walter Lozano walter.lozano@collabora.com

Edited by Walter Lozano

Merge request reports