Skip to content
Snippets Groups Projects
  • Walter Lozano's avatar
    254b71ed
    Use JSON to improve efficiency · 254b71ed
    Walter Lozano authored
    
    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)
    
    Signed-off-by: default avatarWalter Lozano <walter.lozano@collabora.com>
    254b71ed
    History
    Use JSON to improve efficiency
    Walter Lozano authored
    
    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)
    
    Signed-off-by: default avatarWalter Lozano <walter.lozano@collabora.com>