mirror of
https://github.com/voson-wang/toon.git
synced 2026-01-29 15:24:10 +08:00
docs: add YAML comparison example to README (#122)
Added YAML example as well as it's more fair to compare to YAML than to JSON. Note then when objects or arrays contain more nesting TOON might actually become less efficient than YAML.
This commit is contained in:
14
README.md
14
README.md
@@ -46,7 +46,19 @@ AI is becoming cheaper and more accessible, but larger context windows allow for
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
TOON conveys the same information with **fewer tokens**:
|
YAML conveys the same infromation with **fewer tokens**:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
users:
|
||||||
|
- id: 1
|
||||||
|
name: Alice
|
||||||
|
role: admin
|
||||||
|
- id: 2
|
||||||
|
name: Bob
|
||||||
|
role: user
|
||||||
|
```
|
||||||
|
|
||||||
|
TOON conveys the same information with even **fewer tokens**:
|
||||||
|
|
||||||
```
|
```
|
||||||
users[2]{id,name,role}:
|
users[2]{id,name,role}:
|
||||||
|
|||||||
Reference in New Issue
Block a user