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:
woutervancgi
2025-11-13 14:52:45 +01:00
committed by GitHub
parent 95ac0b0cbc
commit dc983b42ab

View File

@@ -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}: