Skip to content

Commit

Permalink
✨ Add speed test for dumping (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
pwwang committed Nov 12, 2022
1 parent 766a74f commit 770e66c
Show file tree
Hide file tree
Showing 9 changed files with 185 additions and 148 deletions.
57 changes: 30 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,51 +247,54 @@ parsing error.

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

Test the speed of loading data provided by `pytomlpp`
Test the speed of loading and dumping the loaded
using data provided by `pytomlpp`

> https://github.com/bobfang1992/pytomlpp/raw/master/benchmark/data.toml

| |Speed|
|-|-----------------------|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|7.71s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|3.27s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|67.25s (5000 iterations)|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|1.20s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.60s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|17.69s (5000 iterations)|
| |Loading speed|Dumping speed|
|-|-|-|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|7.04s (5000 iterations)|1.75s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|3.53s (5000 iterations)|1.21s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|63.07s (5000 iterations)|1.14s (5000 iterations)|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|0.96s (5000 iterations)|0.62s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.56s (5000 iterations)|0.36s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|11.06s (5000 iterations)|2.61s (5000 iterations)|

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

Test the speed of loading data provided by `rtoml`
Test the speed of loading and dumping the loaded using data
provided by `rtoml`

> https://github.com/samuelcolvin/rtoml/raw/main/tests/data.toml

| |Speed|
|-|-----------------------|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|17.75s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|7.09s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|168.17s (5000 iterations)|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|1.28s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.93s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|25.39s (5000 iterations)|
| |Loading speed|Dumping speed|
|-|-|-|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|16.57s (5000 iterations)|2.30s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|7.90s (5000 iterations)|2.55s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|154.61s (5000 iterations)|3.38s (5000 iterations)|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|1.34s (5000 iterations)|0.97s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.92s (5000 iterations)|0.24s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|22.86s (5000 iterations)|6.83s (5000 iterations)|

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

Test the speed of loading data provided by `tomli`
Test the speed of loading and dumping the loaded using data
provided by `tomli`

> https://github.com/hukkin/tomli/raw/master/benchmark/data.toml

| |Speed|
|-|-----------------------|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|13.31s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|5.38s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|102.82s (5000 iterations)|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|1.19s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.77s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|18.19s (5000 iterations)|
| |Loading speed|Dumping speed|
|-|-|-|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|11.71s (5000 iterations)|1.83s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|5.09s (5000 iterations)|2.10s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|104.04s (5000 iterations)|1.65s (5000 iterations)|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|1.25s (5000 iterations)|0.78s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.72s (5000 iterations)|0.42s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|15.73s (5000 iterations)|4.10s (5000 iterations)|



Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["pwwang <[email protected]>"]
license = "MIT"

[tool.poetry.dependencies]
benchwork = "^0.0.1"
benchwork = "^0.0.2"
python = "^3.9"
pyparam = "^0.5"
toml = "^0.10.2"
Expand Down
57 changes: 30 additions & 27 deletions reports/with_python3.11.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,49 +239,52 @@ parsing error.

## Running speed with data provided by `pytomlpp`

Test the speed of loading data provided by `pytomlpp`
Test the speed of loading and dumping the loaded
using data provided by `pytomlpp`

> https://github.com/bobfang1992/pytomlpp/raw/master/benchmark/data.toml

| |Speed|
|-|-----------------------|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|7.40s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|3.79s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|43.83s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.58s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|7.97s (5000 iterations)|
|<a target="_blank" href="https://docs.python.org/3/library/tomllib.html">tomllib</a>|2.74s (5000 iterations)|
| |Loading speed|Dumping speed|
|-|-|-|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|7.10s (5000 iterations)|1.36s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|3.58s (5000 iterations)|1.00s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|55.32s (5000 iterations)|0.97s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.64s (5000 iterations)|0.36s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|7.93s (5000 iterations)|2.12s (5000 iterations)|
|<a target="_blank" href="https://docs.python.org/3/library/tomllib.html">tomllib</a>|2.90s (5000 iterations)|Dumping not supported|

## Running speed with data provided by `rtoml`

Test the speed of loading data provided by `rtoml`
Test the speed of loading and dumping the loaded using data
provided by `rtoml`

> https://github.com/samuelcolvin/rtoml/raw/main/tests/data.toml

| |Speed|
|-|-----------------------|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|15.36s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|5.09s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|115.69s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.90s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|12.66s (5000 iterations)|
|<a target="_blank" href="https://docs.python.org/3/library/tomllib.html">tomllib</a>|5.53s (5000 iterations)|
| |Loading speed|Dumping speed|
|-|-|-|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|19.56s (5000 iterations)|2.83s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|7.09s (5000 iterations)|2.32s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|128.25s (5000 iterations)|3.22s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.90s (5000 iterations)|0.24s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|13.20s (5000 iterations)|4.96s (5000 iterations)|
|<a target="_blank" href="https://docs.python.org/3/library/tomllib.html">tomllib</a>|5.63s (5000 iterations)|Dumping not supported|

## Running speed with data provided by `tomli`

Test the speed of loading data provided by `tomli`
Test the speed of loading and dumping the loaded using data
provided by `tomli`

> https://github.com/hukkin/tomli/raw/master/benchmark/data.toml

| |Speed|
|-|-----------------------|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|10.84s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|4.13s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|75.64s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.81s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|10.07s (5000 iterations)|
|<a target="_blank" href="https://docs.python.org/3/library/tomllib.html">tomllib</a>|3.89s (5000 iterations)|
| |Loading speed|Dumping speed|
|-|-|-|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|10.93s (5000 iterations)|1.82s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|4.24s (5000 iterations)|1.50s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|76.78s (5000 iterations)|1.16s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.71s (5000 iterations)|0.41s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|9.42s (5000 iterations)|3.80s (5000 iterations)|
|<a target="_blank" href="https://docs.python.org/3/library/tomllib.html">tomllib</a>|3.99s (5000 iterations)|Dumping not supported|

57 changes: 30 additions & 27 deletions reports/with_toml-test_latest.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,49 +239,52 @@ parsing error.

## Running speed with data provided by `pytomlpp`

Test the speed of loading data provided by `pytomlpp`
Test the speed of loading and dumping the loaded
using data provided by `pytomlpp`

> https://github.com/bobfang1992/pytomlpp/raw/master/benchmark/data.toml

| |Speed|
|-|-----------------------|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|7.71s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|3.27s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|67.25s (5000 iterations)|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|1.20s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.60s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|17.69s (5000 iterations)|
| |Loading speed|Dumping speed|
|-|-|-|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|7.04s (5000 iterations)|1.75s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|3.53s (5000 iterations)|1.21s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|63.07s (5000 iterations)|1.14s (5000 iterations)|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|0.96s (5000 iterations)|0.62s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.56s (5000 iterations)|0.36s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|11.06s (5000 iterations)|2.61s (5000 iterations)|

## Running speed with data provided by `rtoml`

Test the speed of loading data provided by `rtoml`
Test the speed of loading and dumping the loaded using data
provided by `rtoml`

> https://github.com/samuelcolvin/rtoml/raw/main/tests/data.toml

| |Speed|
|-|-----------------------|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|17.75s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|7.09s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|168.17s (5000 iterations)|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|1.28s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.93s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|25.39s (5000 iterations)|
| |Loading speed|Dumping speed|
|-|-|-|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|16.57s (5000 iterations)|2.30s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|7.90s (5000 iterations)|2.55s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|154.61s (5000 iterations)|3.38s (5000 iterations)|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|1.34s (5000 iterations)|0.97s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.92s (5000 iterations)|0.24s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|22.86s (5000 iterations)|6.83s (5000 iterations)|

## Running speed with data provided by `tomli`

Test the speed of loading data provided by `tomli`
Test the speed of loading and dumping the loaded using data
provided by `tomli`

> https://github.com/hukkin/tomli/raw/master/benchmark/data.toml

| |Speed|
|-|-----------------------|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|13.31s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|5.38s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|102.82s (5000 iterations)|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|1.19s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.77s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|18.19s (5000 iterations)|
| |Loading speed|Dumping speed|
|-|-|-|
|<a target="_blank" href="https://github.com/uiri/toml">toml</a>|11.71s (5000 iterations)|1.83s (5000 iterations)|
|<a target="_blank" href="https://github.com/hukkin/tomli">tomli/tomli_w</a>|5.09s (5000 iterations)|2.10s (5000 iterations)|
|<a target="_blank" href="https://github.com/sdispater/tomlkit">tomlkit</a>|104.04s (5000 iterations)|1.65s (5000 iterations)|
|<a target="_blank" href="https://github.com/bobfang1992/pytomlpp">pytomlpp</a>|1.25s (5000 iterations)|0.78s (5000 iterations)|
|<a target="_blank" href="https://github.com/samuelcolvin/rtoml">rtoml</a>|0.72s (5000 iterations)|0.42s (5000 iterations)|
|<a target="_blank" href="https://github.com/alethiophile/qtoml">qtoml</a>|15.73s (5000 iterations)|4.10s (5000 iterations)|

Loading

0 comments on commit 770e66c

Please sign in to comment.