Skip to content

Conversation

@x100111010
Copy link
Contributor

It follows the same approach used in elichai/kaspa-miner@f759ce3 by @elichai adapted for the hashes crate.

Benchmarks with:
cargo bench -p kaspa-hashes --features no-asm and cargo bench -p kaspa-hashes

PoWHash including timestamp
                        time:   [225.16 ns 225.50 ns 225.86 ns]
                        change: [-20.500% -20.193% -19.890%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
  3 (3.00%) high mild
  4 (4.00%) high severe

PoWHash without timestamp
                        time:   [220.29 ns 220.71 ns 221.19 ns]
                        change: [-21.103% -20.809% -20.508%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe
KHeavyHash              time:   [215.44 ns 215.73 ns 216.02 ns]
                        change: [-20.636% -20.326% -19.935%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
  6 (6.00%) high mild
  2 (2.00%) high severe

Copy link
Member

@elichai elichai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Compared against kaspa-miner:

❯ gh pr checkout 694

❯ diff crypto/hashes/src/asm/keccakf1600_x86-64-elf.s ../kaspa-miner/src/asm/keccakf1600_x86-64-elf.s

❯ diff crypto/hashes/src/asm/keccakf1600_x86-64-mingw64.s ../kaspa-miner/src/asm/keccakf1600_x86-64-mingw64.s

❯ diff crypto/hashes/src/asm/keccakf1600_x86-64-msvc.asm ../kaspa-miner/src/asm/keccakf1600_x86-64-msvc.asm

❯ diff crypto/hashes/src/asm/keccakf1600_x86-64-osx.s ../kaspa-miner/src/asm/keccakf1600_x86-64-osx.s

❯ diff crypto/hashes/src/asm/keccakf1600_x86-64-win64.s ../kaspa-miner/src/asm/keccakf1600_x86-64-win64.s

❯ diff crypto/hashes/build.rs ../kaspa-miner/build.rs
3a4
>     println!("cargo:rerun-if-changed=proto");
5c6,12
<
---
>     tonic_build::configure()
>         .build_server(false)
>         // .type_attribute(".", "#[derive(Debug)]")
>         .compile(
>             &["proto/rpc.proto", "proto/p2p.proto", "proto/messages.proto"],
>             &["proto"],
>         )?;
8c15
<     let target_env = env::var("CARGO_CFG_TARGET_ENV").unwrap_or_default();
---
>     let target_env = env::var("CARGO_CFG_TARGET_ENV").unwrap();

And compared the Cargo.toml and pow_hashers.rs manually

@someone235 someone235 merged commit fe7c01a into kaspanet:master Nov 2, 2025
6 checks passed
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.

3 participants