Debian Codegraph @

docs/src/why/speed-not-a-priority.md

raw
1 ---
2 title: Why is parsing speed not a high priority for StrictYAML?
3 ---
4
5 JSON and StrictYAML are essentially complementary formats. They both allow
6 a relatively loose representation of data that just contains, mappings and
7 sequences. They are serialization formats that are relatively straightforward
8 for both humans and machines to read and write.
9
10 The main difference is simply one of degree:
11
12 JSON is primarily optimized for *machine* readability and writability, while
13 still maintaining human readability.
14
15 YAML is optimized for *human* readability and writability, while maintaining
16 machine readability and writability.
17
18 This means that the two formats are better suited to slightly different applications.
19 For instance, JSON is better suited as a format for use with REST APIs while
20 YAML is better suited as a format for use by configuration languages and DSLs.
21
22 If you are using YAML primarily as a readable medium to express a markup language
23 or represent configuration in, this probably means that 1) what you are reading is
24 probably relatively short (e.g. < 1,000 lines) and 2) it will be read/written
25 infrequently (e.g. once, when a program starts).
26
27 For this reason, it is assumed that for most StrictYAML applications, parsing
28 speed is of a lower importance than strictness, readability and ease of use.
29
30 That being said, any requests that improve parsing or writing speed are welcome.