Skip to content

Commit

Permalink
Fix #5
Browse files Browse the repository at this point in the history
  • Loading branch information
pwwang committed Sep 21, 2023
1 parent deccafc commit 12838f4
Show file tree
Hide file tree
Showing 7 changed files with 199 additions and 189 deletions.
72 changes: 36 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ Literally `<package>.dumps({"v": [1, 1.2, True, "string"]})`

| |Dumped value or error|
|-|-----------------------|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|v = [ 1, 1.2, true, "string",]<br />|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|v = [<br /> 1,<br /> 1.2,<br /> true,<br /> "string",<br />]<br />|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|v = [1, 1.2, true, "string"]<br />|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|v = [ 1, 1.2, 1, 'string' ]|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|v = [1, 1.2, true, "string"]<br />|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|v = [1, 1.2, true, 'string']<br />|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|v&nbsp;=&nbsp;\[&nbsp;1,&nbsp;1.2,&nbsp;true,&nbsp;"string",\]<br />|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|v&nbsp;=&nbsp;\[<br />&nbsp;&nbsp;&nbsp;&nbsp;1,<br />&nbsp;&nbsp;&nbsp;&nbsp;1.2,<br />&nbsp;&nbsp;&nbsp;&nbsp;true,<br />&nbsp;&nbsp;&nbsp;&nbsp;"string",<br />\]<br />|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|v&nbsp;=&nbsp;\[1,&nbsp;1.2,&nbsp;true,&nbsp;"string"\]<br />|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|v&nbsp;=&nbsp;\[&nbsp;1,&nbsp;1.2,&nbsp;1,&nbsp;'string'&nbsp;\]|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|v&nbsp;=&nbsp;\[1,&nbsp;1.2,&nbsp;true,&nbsp;"string"\]<br />|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|v&nbsp;=&nbsp;\[1,&nbsp;1.2,&nbsp;true,&nbsp;'string'\]<br />|

### Loading a heterogenous array

Expand All @@ -111,11 +111,11 @@ Literally `<package>.loads('v = [1, 1.2, True, "string"]')`
| |Loaded as|
|-|-----------------------|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|Not a homogeneous array (line 2 column 1 char 1)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|{'v': [1, 1.2, True, 'string']}|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|{'v': [1, 1.2, True, 'string']}|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|{'v': [1, 1.2, True, 'string']}|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|{'v': [1, 1.2, True, 'string']}|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|{'v': [1, 1.2, True, 'string']}|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|`{'v': [1, 1.2, True, 'string']}`|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|`{'v': [1, 1.2, True, 'string']}`|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|`{'v': [1, 1.2, True, 'string']}`|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|`{'v': [1, 1.2, True, 'string']}`|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|`{'v': [1, 1.2, True, 'string']}`|

### Dumping a nested array

Expand All @@ -126,12 +126,12 @@ Literally `<package>.dumps({"v": [[1], [1, 2]]})`

| |Dumped value or error|
|-|-----------------------|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|<pre>v = [ [ 1,], [ 1, 2,],]<br /></pre>|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|<pre>v = [<br /> [<br /> 1,<br /> ],<br /> [<br /> 1,<br /> 2,<br /> ],<br />]<br /></pre>|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|<pre>v = [[1], [1, 2]]<br /></pre>|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|<pre>v = [ [ 1 ], [ 1, 2 ] ]</pre>|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|<pre>v = [[1], [1, 2]]<br /></pre>|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|<pre>v = [[1], [1, 2]]<br /></pre>|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|v&nbsp;=&nbsp;\[&nbsp;\[&nbsp;1,\],&nbsp;\[&nbsp;1,&nbsp;2,\],\]<br />|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|v&nbsp;=&nbsp;\[<br />&nbsp;&nbsp;&nbsp;&nbsp;\[<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1,<br />&nbsp;&nbsp;&nbsp;&nbsp;\],<br />&nbsp;&nbsp;&nbsp;&nbsp;\[<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2,<br />&nbsp;&nbsp;&nbsp;&nbsp;\],<br />\]<br />|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|v&nbsp;=&nbsp;\[\[1\],&nbsp;\[1,&nbsp;2\]\]<br />|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|v&nbsp;=&nbsp;\[&nbsp;\[&nbsp;1&nbsp;\],&nbsp;\[&nbsp;1,&nbsp;2&nbsp;\]&nbsp;\]|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|v&nbsp;=&nbsp;\[\[1\],&nbsp;\[1,&nbsp;2\]\]<br />|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|v&nbsp;=&nbsp;\[\[1\],&nbsp;\[1,&nbsp;2\]\]<br />|

### Loading a nested array

Expand All @@ -142,12 +142,12 @@ Literally `<package>.loads('v = [[1], [1, 2]]')`

| |Loaded as|
|-|-----------------------|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|{'v': [[1], [1, 2]]}|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|{'v': [[1], [1, 2]]}|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|{'v': [[1], [1, 2]]}|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|{'v': [[1], [1, 2]]}|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|{'v': [[1], [1, 2]]}|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|{'v': [[1], [1, 2]]}|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|`{'v': [[1], [1, 2]]}`|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|`{'v': [[1], [1, 2]]}`|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|`{'v': [[1], [1, 2]]}`|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|`{'v': [[1], [1, 2]]}`|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|`{'v': [[1], [1, 2]]}`|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|`{'v': [[1], [1, 2]]}`|

### Dumping keeps order of keys?

Expand Down Expand Up @@ -320,11 +320,11 @@ using data provided by `pytomlpp`
| |Loading speed|Dumping speed|
|-|-|-|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|Excluded (heterogeneous arrays not supported)|Excluded (heterogeneous arrays not supported)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|7.44s (1000 iterations)|3.69s (1000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|136.86s (1000 iterations)|2.54s (1000 iterations)|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|1.37s (1000 iterations)|0.96s (1000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|7.55s (1000 iterations)|3.11s (1000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|150.98s (1000 iterations)|2.14s (1000 iterations)|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|1.41s (1000 iterations)|0.98s (1000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.98s (1000 iterations)|values must be emitted before tables|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|19.28s (1000 iterations)|5.15s (1000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|18.39s (1000 iterations)|4.75s (1000 iterations)|

### Running speed with data provided by `rtoml`

Expand All @@ -337,11 +337,11 @@ provided by `rtoml`
| |Loading speed|Dumping speed|
|-|-|-|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|Excluded (heterogeneous arrays not supported)|Excluded (heterogeneous arrays not supported)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|1.80s (1000 iterations)|0.68s (1000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|30.51s (1000 iterations)|0.82s (1000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|1.56s (1000 iterations)|0.55s (1000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|29.90s (1000 iterations)|0.75s (1000 iterations)|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|0.24s (1000 iterations)|0.19s (1000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.19s (1000 iterations)|0.05s (1000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|4.62s (1000 iterations)|1.32s (1000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|4.57s (1000 iterations)|1.26s (1000 iterations)|

### Running speed with data provided by `tomli`

Expand All @@ -354,11 +354,11 @@ provided by `tomli`
| |Loading speed|Dumping speed|
|-|-|-|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|Excluded (heterogeneous arrays not supported)|Excluded (heterogeneous arrays not supported)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|1.17s (1000 iterations)|0.38s (1000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|18.75s (1000 iterations)|0.40s (1000 iterations)|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|0.24s (1000 iterations)|0.15s (1000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.16s (1000 iterations)|0.11s (1000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|3.72s (1000 iterations)|0.94s (1000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|1.11s (1000 iterations)|0.38s (1000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|19.39s (1000 iterations)|0.37s (1000 iterations)|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|0.25s (1000 iterations)|0.18s (1000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.20s (1000 iterations)|0.11s (1000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|3.61s (1000 iterations)|0.94s (1000 iterations)|



Expand Down Expand Up @@ -404,7 +404,7 @@ toml-bench --comver 1.0.0
#### Use a different number of iterations in speed tests

```shell
toml-bench --iter 1000
toml-bench --iter 5000
```

#### Test with different versions of packages
Expand Down
2 changes: 1 addition & 1 deletion README.raw.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ toml-bench --comver 1.0.0
#### Use a different number of iterations in speed tests

```shell
toml-bench --iter 1000
toml-bench --iter 5000
```

#### Test with different versions of packages
Expand Down
Loading

0 comments on commit 12838f4

Please sign in to comment.