Have discussed before but thought I should file a bug for this so there is a record.
The json file is:
- not very easy for humans to read
- verbose
- duplicative at the property level (e.g. expanded templates)
- redundant (it repeats all the information common to multiple models)
Even the small test file we use is >3 times larger in json than in yaml:
$ wc libcros_config/test.*
349 803 7317 libcros_config/test.dts
723 1214 25212 libcros_config/test.json
314 644 9969 libcros_config/test.yaml
1386 2661 42498 total
For a real project (e.g. coral) we might see JSON files at >5k lines and >100KB and this will only grow as we add more config to the schema. I have not done a coral conversion so this is just a guess.
Using json adds code and process complication at build time and does not simplify the run-time code (since it is a simple function call to get the json from a yaml file). It is much harder to inspect the json config than either yaml or device tree, because everything is so huge, and full of extraneous info like directory paths.
On the human benefit side I don't see anything that cannot be handled by tooling - .e.g. we already have a way to dump json to inspect the blown-out yaml. I don't have any evidence that it is faster at run-time to look at json rather than yaml (although it might be).
So I think we should consider just using yaml on the device.
Comment 1 by shapiroc@chromium.org
, Apr 13 2018