forked from robherring/dt-schema
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
validator: Rework selecting schemas for validation
Validation of devicetrees is slow because every schema is checked whether to apply it or not to every node. With 1000s of schemas and 100s-1000s of nodes in 1000s of DTBs, that makes for long validation times. The reality is there's a few schemas that apply to all nodes (mostly the core schemas) and only 1 schema with a matching compatible string that applies (not counting schemas included by $ref). There's also a few corner cases which have their own 'select'. Rework the validation to take advantage of this by storing up front the list of schemas to always iterate thru, and a map of compatible strings to their respective schema. The result is a 6-7x reduction in the validation time. Signed-off-by: Rob Herring <[email protected]>
- Loading branch information
1 parent
ebfb590
commit db9c05a
Showing
2 changed files
with
33 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters