|
24 | 24 | - [Is there a `dumps`, `write` or `encode` function?](#is-there-a-dumps-write-or-encode-function) |
25 | 25 | - [How do TOML types map into Python types?](#how-do-toml-types-map-into-python-types) |
26 | 26 | - [Performance](#performance) |
27 | | - - [Pure Python](#pure-python) |
28 | 27 | - [Mypyc generated wheel](#mypyc-generated-wheel) |
| 28 | + - [Pure Python](#pure-python) |
29 | 29 |
|
30 | 30 | <!-- mdformat-toc end --> |
31 | 31 |
|
@@ -156,7 +156,7 @@ tomllib.loads("['This parses fine with Python 3.6+']") |
156 | 156 | - it's lil' |
157 | 157 | - pure Python with zero dependencies |
158 | 158 | - the fastest pure Python parser [\*](#pure-python): |
159 | | - 18x as fast as [tomlkit](https://pypi.org/project/tomlkit/), |
| 159 | + 14x as fast as [tomlkit](https://pypi.org/project/tomlkit/), |
160 | 160 | 2.1x as fast as [toml](https://pypi.org/project/toml/) |
161 | 161 | - outputs [basic data types](#how-do-toml-types-map-into-python-types) only |
162 | 162 | - 100% spec compliant: passes all tests in |
@@ -202,47 +202,42 @@ The core library does not include write capability, as most TOML use cases are r |
202 | 202 |
|
203 | 203 | The `benchmark/` folder in this repository contains a performance benchmark for comparing the various Python TOML parsers. |
204 | 204 |
|
205 | | -Below are the results for commit [0724e2a](https://github.com/hukkin/tomli/tree/0724e2ab1858da7f5e05a9bffdb24c33589d951c). |
| 205 | +Below are the results for commit [064e492](https://github.com/hukkin/tomli/tree/064e492919b2338def788753b8c981c9131334c0). |
206 | 206 |
|
207 | | -### Pure Python<a name="pure-python"></a> |
| 207 | +### Mypyc generated wheel<a name="mypyc-generated-wheel"></a> |
208 | 208 |
|
209 | 209 | ```console |
210 | 210 | foo@bar:~/dev/tomli$ python --version |
211 | | -Python 3.12.7 |
| 211 | +Python 3.14.2 |
212 | 212 | foo@bar:~/dev/tomli$ pip freeze |
213 | | -attrs==21.4.0 |
214 | | -click==8.1.7 |
215 | | -pytomlpp==1.0.13 |
216 | | -qtoml==0.3.1 |
217 | | -rtoml==0.11.0 |
| 213 | +pytomlpp==1.1.0 |
| 214 | +rtoml==0.13.0 |
218 | 215 | toml==0.10.2 |
219 | 216 | tomli @ file:///home/foo/dev/tomli |
220 | | -tomlkit==0.13.2 |
| 217 | +tomlkit==0.13.3 |
221 | 218 | foo@bar:~/dev/tomli$ python benchmark/run.py |
222 | 219 | Parsing data.toml 5000 times: |
223 | 220 | ------------------------------------------------------ |
224 | 221 | parser | exec time | performance (more is better) |
225 | 222 | -----------+------------+----------------------------- |
226 | | - rtoml | 0.647 s | baseline (100%) |
227 | | - pytomlpp | 0.891 s | 72.62% |
228 | | - tomli | 3.14 s | 20.56% |
229 | | - toml | 6.69 s | 9.67% |
230 | | - qtoml | 8.27 s | 7.82% |
231 | | - tomlkit | 56.1 s | 1.15% |
| 223 | + rtoml | 0.328 s | baseline (100%) |
| 224 | + pytomlpp | 0.365 s | 89.75% |
| 225 | + tomli | 0.838 s | 39.12% |
| 226 | + toml | 3.01 s | 10.90% |
| 227 | + tomlkit | 20.7 s | 1.59% |
232 | 228 | ``` |
233 | 229 |
|
234 | | -### Mypyc generated wheel<a name="mypyc-generated-wheel"></a> |
| 230 | +### Pure Python<a name="pure-python"></a> |
235 | 231 |
|
236 | 232 | ```console |
237 | 233 | foo@bar:~/dev/tomli$ python benchmark/run.py |
238 | 234 | Parsing data.toml 5000 times: |
239 | 235 | ------------------------------------------------------ |
240 | 236 | parser | exec time | performance (more is better) |
241 | 237 | -----------+------------+----------------------------- |
242 | | - rtoml | 0.668 s | baseline (100%) |
243 | | - pytomlpp | 0.893 s | 74.81% |
244 | | - tomli | 1.96 s | 34.18% |
245 | | - toml | 6.64 s | 10.07% |
246 | | - qtoml | 8.26 s | 8.09% |
247 | | - tomlkit | 52.9 s | 1.26% |
| 238 | + rtoml | 0.323 s | baseline (100%) |
| 239 | + pytomlpp | 0.365 s | 88.40% |
| 240 | + tomli | 1.44 s | 22.36% |
| 241 | + toml | 3.03 s | 10.65% |
| 242 | + tomlkit | 20.6 s | 1.57% |
248 | 243 | ``` |
0 commit comments