Skip to content

Commit

Permalink
fix: update bench results and run clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuthor committed Nov 21, 2023
1 parent cbaa37e commit d14b51f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ repos:
- id: cargo-test-doc
- id: clippy-autofix-all
- id: clippy-autofix-pedantic
- id: clippy-autofix-nursery
- id: clippy-autofix-others
- id: clippy-all-targets-all-features
- id: stable-cargo-format
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ cosmian_crypto_core = { version = "9.3.0", default-features = false, features =
never = "0.1.0"
tiny-keccak = { version = "2.0.2", features = ["kmac", "sha3"] }
tracing = "0.1"
zeroize = "1.6.0"
zeroize = "1.7.0"

[dev-dependencies]
actix-rt = "2.9.0"
criterion = "0.5.1"
futures = "0.3.28"
futures = "0.3.29"
rand = "0.8.5"

[[bench]]
Expand Down
8 changes: 4 additions & 4 deletions benches/BENCHMARKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

- [Overview](#overview)
- [Benchmark Results](#benchmark-results)
- [search](#search)
- [upsert](#upsert)
- [search](#search)
- [upsert](#upsert)

## Overview

Expand All @@ -17,13 +17,13 @@ This is a benchmark comparison report.

| | `Searching 1 keyword(s)` | `Searching 10 keyword(s)` | `Searching 100 keyword(s)` | `Searching 1000 keyword(s)` |
|:-------|:----------------------------------|:-----------------------------------|:------------------------------------|:------------------------------------- |
| | `11.18 us` (✅ **1.00x**) | `99.07 us` (❌ *8.86x slower*) | `1.01 ms` (❌ *90.42x slower*) | `10.85 ms` (❌ *970.72x slower*) |
| | `7.26 us` (✅ **1.00x**) | `60.26 us` (❌ *8.31x slower*) | `597.19 us` (❌ *82.31x slower*) | `6.02 ms` (❌ *829.65x slower*) |

### upsert

| | `Upserting 10 keyword(s)` | `Upserting 100 keyword(s)` | `Upserting 1000 keyword(s)` |
|:-------|:-----------------------------------|:------------------------------------|:------------------------------------- |
| | `180.68 us` (✅ **1.00x**) | `1.80 ms` (❌ *9.95x slower*) | `18.24 ms` (❌ *100.95x slower*) |
| | `113.48 us` (✅ **1.00x**) | `1.12 ms` (❌ *9.87x slower*) | `11.51 ms` (❌ *101.42x slower*) |

---
Made with [criterion-table](https://github.com/nu11ptr/criterion-table)
2 changes: 1 addition & 1 deletion src/edx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ pub mod in_memory {
}

let mut res = HashMap::new();
for (token, new_ciphertext) in new_values.into_iter() {
for (token, new_ciphertext) in new_values {
let old_ciphertext = old_values.get(&token);
let edx_ciphertext = edx.get(&token);

Expand Down
4 changes: 2 additions & 2 deletions src/findex_graph/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ pub enum IndexedValue<Tag, Value> {
impl<Tag: Display, Value: Display> Display for IndexedValue<Tag, Value> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
IndexedValue::Pointer(keyword) => write!(f, "IndexedValue::Pointer({keyword})"),
IndexedValue::Data(location) => write!(f, "IndexedValue::Data({location})"),
Self::Pointer(keyword) => write!(f, "IndexedValue::Pointer({keyword})"),
Self::Data(location) => write!(f, "IndexedValue::Data({location})"),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/findex_mm/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ where
STANDARD.encode(self.tag_hash),
self.chain_token
.as_ref()
.map(|token| token.to_string())
.map(std::string::ToString::to_string)
.unwrap_or_default()
)
}
Expand Down

0 comments on commit d14b51f

Please sign in to comment.