Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rosetta-rs/parse-rosetta-rs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 32ee0a1b19d190deb2c5cfefc211a89c10e48f2b
Choose a base ref
..
head repository: rosetta-rs/parse-rosetta-rs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 02ed59f90a259379aca448fc4207a16c8196a079
Choose a head ref
7 changes: 5 additions & 2 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"schedule": [
"before 3am on the first day of the month"
],
"semanticCommits": "enabled",
"configMigration": true,
"packageRules": [
@@ -10,14 +13,14 @@
"matchCurrentVersion": ">=0.1.0",
"matchUpdateTypes": ["patch"],
"automerge": true,
"groupName": "safe",
"groupName": "compatible",
},
{
"matchManagers": ["cargo"],
"matchCurrentVersion": ">=1.0.0",
"matchUpdateTypes": ["minor"],
"automerge": true,
"groupName": "safe",
"groupName": "compatible",
},
],
}
173 changes: 107 additions & 66 deletions Cargo.lock

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

29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

This repo tries to assess Rust parsing performance.

| crate | parser type | action code | integration | input type | precedence climbing | parameterized rules | streaming input |
| crate | parser type | action code | integration | input type | precedence climbing | parameterized rules | streaming input |
|-----------|-------------|-------------|--------------------|------------------------|---------------------|---------------------|-----------------|
| [chumsky] | combinators | in source | library | `&str` | ? | ? | ? |
| [combine] | combiantors | in source | library | `&str` | ? | ? | ? |
@@ -11,20 +11,22 @@ This repo tries to assess Rust parsing performance.
| [peg] | PEG | in grammar | proc macro (block) | `&str`, `&[T]`, custom | Yes | Yes | No |
| [pest] | PEG | external | proc macro (file) | `&str` | Yes | No | No |
| [pom] | combiantors | in source | library | `&str` | ? | ? | ? |
| [winnow] | combinators | in source | library | `&str`, `&[T]`, custom | No | Yes | Yes |

# Results

Name | Overhead (release) | Build (debug) | Parse (release) | Downloads | Version
-----|--------------------|---------------|-----------------|-----------|--------
null | 0 KiB | 306ms | 28ms | - | -
chumsky | 887 KiB | 5s | 730ms | ![Download count](https://img.shields.io/crates/dr/ariadne) | v0.1.5
combine | 214 KiB | 3s | 452ms | ![Download count](https://img.shields.io/crates/dr/combine) | v3.8.1
nom | 160 KiB | 2s | 507ms | ![Download count](https://img.shields.io/crates/dr/nom) | v7.1.1
peg | 33 KiB | 2s | **invalid** | ![Download count](https://img.shields.io/crates/dr/peg) | v0.8.0
pest | 138 KiB | 940ms | 416ms | ![Download count](https://img.shields.io/crates/dr/pest) | v2.1.3
pom | 217 KiB | 628ms | 816ms | ![Download count](https://img.shields.io/crates/dr/pom) | v3.2.0
null | 0 KiB | 391ms | 22ms | - | -
chumsky | 773 KiB | 8s | 1s | ![Download count](https://img.shields.io/crates/dr/ariadne) | v0.1.5
combine | 228 KiB | 5s | 867ms | ![Download count](https://img.shields.io/crates/dr/combine) | v3.8.1
nom | 161 KiB | 2s | 848ms | ![Download count](https://img.shields.io/crates/dr/nom) | v7.1.3
peg | 29 KiB | 2s | **invalid** | ![Download count](https://img.shields.io/crates/dr/peg) | v0.8.1
pest | 143 KiB | 5s | 757ms | ![Download count](https://img.shields.io/crates/dr/pest) | v2.5.5
pom | 215 KiB | 890ms | 2s | ![Download count](https://img.shields.io/crates/dr/pom) | v3.2.0
winnow | 143 KiB | 2s | 747ms | ![Download count](https://img.shields.io/crates/dr/winnow) | v0.3.0

*System: Linux 5.10.16.3-microsoft-standard-WSL2 (x86_64) w/ `-j 20`*
*System: Linux 5.4.0-104-generic (x86_64) w/ `-j 8`*

Note:
- For more "Parse (release)" comparisons, see [parser_benchmarks](https://github.com/rust-bakery/parser_benchmarks)
@@ -37,10 +39,11 @@ $ ./bench.py
$ ./format.py
```

[peg]: https://github.com/kevinmehall/rust-peg
[pest]: https://github.com/pest-parser/pest
[nom]: https://github.com/geal/nom
[lalrpop]: https://github.com/lalrpop/lalrpop
[chumsky]: https://github.com/zesterer/chumsky
[combine]: https://github.com/Marwes/combine
[lalrpop]: https://github.com/lalrpop/lalrpop
[nom]: https://github.com/geal/nom
[peg]: https://github.com/kevinmehall/rust-peg
[pest]: https://github.com/pest-parser/pest
[pom]: https://github.com/j-f-liu/pom
[winnow]: https://github.com/winnow-rs/winnow
4 changes: 3 additions & 1 deletion bench.py
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
import pathlib
import platform
import subprocess
import sys
import tempfile


@@ -17,6 +18,7 @@ def main():
hostname = platform.node()
uname = platform.uname()
cpus = multiprocessing.cpu_count()
extension = ".exe" if sys.platform in ("win32", "cygwin") else ""

runs_root = repo_root / "runs"
runs_root.mkdir(parents=True, exist_ok=True)
@@ -67,7 +69,7 @@ def main():
if True:
# Doing release builds because that is where size probably matters most
subprocess.run(["cargo", "build", "--release", "--package", example_path.name], cwd=repo_root, check=True)
app_path = repo_root / f"target/release/{example_path.name}"
app_path = repo_root / f"target/release/{example_path.name}{extension}"
file_size = app_path.stat().st_size
else:
app_path = None
2 changes: 1 addition & 1 deletion examples/chumsky-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -9,4 +9,4 @@ path = "app.rs"

[dependencies]
ariadne = "0.1.5"
chumsky = "0.8.0"
chumsky = "0.9.0"
Loading