New issue
Advanced search Search tips

Issue 827834 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Consider dropping the json file

Project Member Reported by sjg@chromium.org, Apr 1 2018

Issue description

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.
 
No plans to do this ...

the json file provides clarity also in the development flow.

if performance became a concern, I'd convert to gen'd c++ instead.
Owner: sjg@chromium.org
Status: Assigned (was: Untriaged)
This bug has an owner, thus, it's been triaged. Changing status to "assigned".

Sign in to add a comment