Skip to content

Conversation

epage
Copy link
Member

@epage epage commented Jun 16, 2025

I chose foldhash because it is the default of [email protected] (replacing ahash), see rust-lang/hashbrown#563.

Currently, ahash is the only hasher I noticed inside of Cargo and that is coming in from [email protected].

In the future, we could consider allowing the use of a FixedState so we could offer IndexMap on alloc.

$ cargo bench --bench 0-cargo -Fpreserve_order -- 0_cargo::toml::document::2-features
   Compiling toml v0.5.11
   Compiling toml v0.8.23 (/home/epage/src/personal/toml/crates/toml)
   Compiling toml_benchmarks v0.0.0 (/home/epage/src/personal/toml/crates/benchmarks)
    Finished `bench` profile [optimized] target(s) in 19.13s
     Running benches/0-cargo.rs (/home/epage/src/personal/toml/target/release/deps/0_cargo-09d7e00849b1b878)
Timer precision: 11 ns
0_cargo              fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ toml                            │               │               │               │         │
   ╰─ document                     │               │               │               │         │
      ╰─ 2-features  468.8 µs      │ 1.016 ms      │ 513.5 µs      │ 543.5 µs      │ 100     │ 100


$ cargo bench --bench 0-cargo -Ffast_hash -- 0_cargo::toml::document::2-features
    Finished `bench` profile [optimized] target(s) in 0.02s
     Running benches/0-cargo.rs (/home/epage/src/personal/toml/target/release/deps/0_cargo-ea11bd9a52599c35)
Timer precision: 18 ns
0_cargo              fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ toml                            │               │               │               │         │
   ╰─ document                     │               │               │               │         │
      ╰─ 2-features  431.4 µs      │ 870.3 µs      │ 446.2 µs      │ 459.9 µs      │ 100     │ 100

```
$ cargo bench --bench 0-cargo -Fpreserve_order -- 0_cargo::toml::document::2-features
   Compiling toml v0.5.11
   Compiling toml v0.8.23 (/home/epage/src/personal/toml/crates/toml)
   Compiling toml_benchmarks v0.0.0 (/home/epage/src/personal/toml/crates/benchmarks)
    Finished `bench` profile [optimized] target(s) in 19.13s
     Running benches/0-cargo.rs (/home/epage/src/personal/toml/target/release/deps/0_cargo-09d7e00849b1b878)
Timer precision: 11 ns
0_cargo              fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ toml                            │               │               │               │         │
   ╰─ document                     │               │               │               │         │
      ╰─ 2-features  468.8 µs      │ 1.016 ms      │ 513.5 µs      │ 543.5 µs      │ 100     │ 100


$ cargo bench --bench 0-cargo -Ffast_hash -- 0_cargo::toml::document::2-features
    Finished `bench` profile [optimized] target(s) in 0.02s
     Running benches/0-cargo.rs (/home/epage/src/personal/toml/target/release/deps/0_cargo-ea11bd9a52599c35)
Timer precision: 18 ns
0_cargo              fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ toml                            │               │               │               │         │
   ╰─ document                     │               │               │               │         │
      ╰─ 2-features  431.4 µs      │ 870.3 µs      │ 446.2 µs      │ 459.9 µs      │ 100     │ 100
```
@coveralls
Copy link

coveralls commented Jun 16, 2025

Pull Request Test Coverage Report for Build 15690907547

Details

  • 3 of 4 (75.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.008%) to 69.303%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/toml/src/map.rs 3 4 75.0%
Files with Coverage Reduction New Missed Lines %
crates/toml/src/map.rs 1 66.15%
Totals Coverage Status
Change from base Build 15687156076: -0.008%
Covered Lines: 6204
Relevant Lines: 8952

💛 - Coveralls

@epage epage merged commit 4868e7a into toml-rs:main Jun 16, 2025
16 of 17 checks passed
@epage epage deleted the hash branch June 16, 2025 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants