-
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.
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# RFC 40: New Manifest Format (path trie) | ||
|
||
## Summary | ||
|
||
We propose restructuring the manifest to be a trie of path segments, rather than the status-quo of being an object with (full) paths as keys. | ||
|
||
## Detail | ||
|
||
At the moment, the manifest is formed of three components: the url_base (a string), the items (an object of type to object pairs, then an object giving each path and the items contained therein), and the path_hash (storing all the paths—again—and the type & file hash). | ||
|
||
The proposal here is two-fold: | ||
|
||
Firstly, replace the items objects with a series of nested objects forming a trie of path segments. This allows us to make it much quicker to iterate through only specific directories, which is often enough done in a test-debug cycle, as part of redoing the implementation of include/exclude (this is future work for this RFC). | ||
|
||
Secondly, we get rid of path_hash: we migrate the hashes into the item object, thereby getting rid of the duplication of all the paths. This almost halves the size of the JSON created, which when the small-update case was previously dominated by parsing/serializing the JSON is significant. This provides a ~10% speedup running `wpt run` after modifying a single test. | ||
|
||
Additionally, we stop storing the URL if it is identical to the path; this again provides size savings but is not a critical part of this proposal. | ||
|
||
## Risks | ||
|
||
As with any manifest format change, there is a risk that some consumers aren't paying attention to the version field and will fail loudly to cope with the new format. |