Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ jobs:
# This makes caching actually viable for more than just a day
- name: Install nightly toolchain
run: |
rustup toolchain install --profile minimal nightly-2025-01-01
rustup default nightly-2025-01-01
rustup toolchain install --profile minimal nightly-2025-09-01
rustup default nightly-2025-09-01

- name: Cache
uses: Swatinem/rust-cache@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
# Nightly needed for `cargo-llvm`'s `--doctests` flag
toolchain: nightly-2024-04-20
toolchain: nightly-2025-09-01
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
Expand Down
40 changes: 20 additions & 20 deletions BENCHMARKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ The benchmarks cover parsing, rendering, serializing, and deserializing a
file from my steam install. This is a fairly large (20 KiB) VDF file that
contains varying structures, types, nesting, etc.

All of the following results were from running on a Linux machine with a Ryzen
7 3700. You can run all the benchmarks by running either `cargo bench` from the
project directory
All of the following results were from running on a Linux machine with a
`i5-1135G7 @ 4.20 GHz` CPU. You can run all the benchmarks by running
`cargo bench` from the project directory.

## `keyvalues-parser`

| Name | ? |
| Name | Description |
| :---: | :--- |
| `parse` | Parsing the file |
| `render` | Rendering the parsed file back to a `String` |
| `parse` | Parses a `controller_generic_wasd.vdf` file |
| `render` | Renders a parsed `controller_generic_wasd.vdf` to a `String` |

```text
parser fastest │ slowest │ median │ mean │ samples
├─ parse 110.8 µs │ 202.3 µs │ 112.3 µs │ 113.5 µs │ 1759
180.2 MB/s │ 98.74 MB/s │ 177.8 MB/s │ 175.9 MB/s │
╰─ render 113.8 µs │ 161.7 µs │ 116.9 µs │ 117.3 µs │ 1702
167.1 MB/s │ 117.6 MB/s │ 162.6 MB/s │ 162.2 MB/s │
├─ parse 489.3 µs │ 816.2 µs │ 495.2 µs │ 500.3 µs │ 5995
40.83 MB/s │ 24.48 MB/s │ 40.34 MB/s │ 39.93 MB/s │
╰─ render 76.04 µs │ 151.7 µs │ 78.04 µs │ 78.79 µs │ 38015
250.2 MB/s │ 125.4 MB/s │ 243.7 MB/s │ 241.4 MB/s │
```

## `keyvalues-serde`
Expand All @@ -44,15 +44,15 @@ while have a pretty minimal impact compared to the naïve approach_
```text
ser_de fastest │ slowest │ median │ mean │ samples
├─ deserialize │ │ │ │
│ ├─ FullStructBorrowed 210.6 µs │ 400.5 µs │ 216.5 µs │ 218.1 µs │ 910
│ │ 94.85 MB/s │ 49.88 MB/s │ 92.28 MB/s │ 91.57 MB/s │
│ ├─ FullStructOwned 214.4 µs │ 255.7 µs │ 218.7 µs │ 220 µs │ 898
│ │ 93.16 MB/s │ 78.11 MB/s │ 91.33 MB/s │ 90.81 MB/s │
│ ╰─ SingleField 200.9 µs │ 240.5 µs │ 206.7 µs │ 207.5 µs │ 963
99.44 MB/s │ 83.07 MB/s │ 96.64 MB/s │ 96.28 MB/s │
│ ├─ FullStructBorrowed 553.3 µs │ 781.7 µs │ 563 µs │ 569.7 µs │ 5256
│ │ 36.1 MB/s │ 25.56 MB/s │ 35.49 MB/s │ 35.07 MB/s │
│ ├─ FullStructOwned 559.2 µs │ 702 µs │ 568.8 µs │ 576.5 µs │ 5184
│ │ 35.73 MB/s │ 28.46 MB/s │ 35.13 MB/s │ 34.65 MB/s │
│ ╰─ SingleField 545.8 µs │ 907.1 µs │ 558.6 µs │ 563.5 µs │ 5323
36.6 MB/s │ 22.02 MB/s │ 35.77 MB/s │ 35.46 MB/s │
╰─ serialize │ │ │ │
├─ FullStructBorrowed 260.9 µs │ 497.1 µs │ 277.7 µs │ 276.4 µs │ 714
72.85 MB/s │ 38.24 MB/s │ 68.45 MB/s │ 68.76 MB/s │
╰─ FullStructOwned 263.4 µs │ 298.7 µs │ 279.3 µs │ 277.7 µs │ 711
72.15 MB/s │ 63.64 MB/s │ 68.04 MB/s │ 68.43 MB/s │
├─ FullStructBorrowed 155.5 µs │ 244.9 µs │ 162.2 µs │ 168.2 µs │ 16952
122.2 MB/s │ 77.61 MB/s │ 117.2 MB/s │ 113 MB/s
╰─ FullStructOwned 156.2 µs │ 234.1 µs │ 173.2 µs │ 176.8 µs │ 16897
121.6 MB/s │ 81.2 MB/s │ 109.7 MB/s │ 107.4 MB/s │
```
58 changes: 51 additions & 7 deletions Cargo.lock

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

30 changes: 30 additions & 0 deletions keyvalues-parser/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Version 0.2.1

The main headline of this update is significantly slimming down our dependency
tree. We now depend solely on `pest` (and its transitive deps) :tada:

## Fix

- Don't overflow the stack when parsing strings containing many escaped chars [(#94)]

## Deps

- Drop `thiserror` for a manual implementation [(#56)]
- Run `cargo update` and `cargo upgrade` [(#58)]
- Commit generated parser code instead of generating with `pest_derive` [(#95)] [(#96)]

## Docs

- Fix incorrect indentation in README example [(#43)]
- Update installation docs to use `cargo add` [(#58)]
- Spruce up more `Cargo.toml` package fields [(#70)]
- Copy licenses into crates [(#75)]

[(#43)]: https://github.com/CosmicHorrorDev/vdf-rs/pull/43
[(#56)]: https://github.com/CosmicHorrorDev/vdf-rs/pull/56
[(#58)]: https://github.com/CosmicHorrorDev/vdf-rs/pull/58
[(#70)]: https://github.com/CosmicHorrorDev/vdf-rs/pull/70
[(#75)]: https://github.com/CosmicHorrorDev/vdf-rs/pull/75
[(#94)]: https://github.com/CosmicHorrorDev/vdf-rs/pull/94
[(#95)]: https://github.com/CosmicHorrorDev/vdf-rs/pull/95
[(#96)]: https://github.com/CosmicHorrorDev/vdf-rs/pull/96
7 changes: 5 additions & 2 deletions keyvalues-parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "keyvalues-parser"
version = "0.2.0"
version = "0.2.1"
edition = "2021"
license = "MIT OR Apache-2.0"
rust-version = "1.64.0"
rust-version = "1.80.1"

authors = ["Cosmic <CosmicHorrorDev@pm.me>"]
keywords = ["keyvalues", "vdf", "steam", "parser"]
Expand All @@ -12,6 +12,9 @@ description = "A parser/renderer for vdf text"
homepage = "https://github.com/CosmicHorrorDev/vdf-rs/tree/main/keyvalues-parser"
repository = "https://github.com/CosmicHorrorDev/vdf-rs"

[dependencies]
pest = "2.7"

[dev-dependencies]
divan.workspace = true
insta.workspace = true
Expand Down
85 changes: 83 additions & 2 deletions keyvalues-parser/fuzz/Cargo.lock

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

Loading