Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
chore: remove time dep (#22665)
Browse files Browse the repository at this point in the history
* chore: bump time from 0.3.5 to 0.3.6

Bumps [time](https://github.com/time-rs/time) from 0.3.5 to 0.3.6.
- [Release notes](https://github.com/time-rs/time/releases)
- [Changelog](https://github.com/time-rs/time/blob/main/CHANGELOG.md)
- [Commits](time-rs/time@v0.3.5...v0.3.6)

---
updated-dependencies:
- dependency-name: time
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Remove separate time dependency

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
  • Loading branch information
dependabot[bot] and Tyera Eulberg authored Jan 25, 2022
1 parent 8b1cde8 commit 66b44b4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 30 deletions.
11 changes: 0 additions & 11 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion rbpf-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ solana-logger = { path = "../logger", version = "=1.10.0" }
solana-program-runtime = { path = "../program-runtime", version = "=1.10.0" }
solana-sdk = { path = "../sdk", version = "=1.10.0" }
solana_rbpf = "=0.2.21"
time = "0.3.5"
4 changes: 2 additions & 2 deletions rbpf-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ use {
fs::File,
io::{Read, Seek, SeekFrom},
path::Path,
time::Instant,
},
time::Instant,
};

#[derive(Serialize, Deserialize, Debug)]
Expand Down Expand Up @@ -296,7 +296,7 @@ native machine code before execting it in the virtual machine.",
let duration = Instant::now() - start_time;
println!("Result: {:?}", result);
println!("Instruction Count: {}", vm.get_total_instruction_count());
println!("Execution time: {} us", duration.whole_microseconds());
println!("Execution time: {} us", duration.as_micros());
if matches.is_present("trace") {
println!("Trace is saved in trace.out");
let mut file = File::create("trace.out").unwrap();
Expand Down
3 changes: 0 additions & 3 deletions zk-token-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,5 @@ subtle = "2"
thiserror = "1"
zeroize = { version = "1.3", default-features = false, features = ["zeroize_derive"] }

[dev-dependencies]
time = "0.1.40"

[lib]
crate-type = ["cdylib", "rlib"]
22 changes: 9 additions & 13 deletions zk-token-sdk/src/encryption/discrete_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ impl Iterator for RistrettoIterator {

#[cfg(test)]
mod tests {
use {super::*, curve25519_dalek::constants::RISTRETTO_BASEPOINT_POINT as G};
use {
super::*, curve25519_dalek::constants::RISTRETTO_BASEPOINT_POINT as G, std::time::Instant,
};

#[test]
#[allow(non_snake_case)]
Expand Down Expand Up @@ -147,23 +149,17 @@ mod tests {
};

// Very informal measurements for now
let start_precomputation = time::precise_time_s();
let start_precomputation = Instant::now();
let precomputed_hashmap = decode_u32_precomputation(G);
let end_precomputation = time::precise_time_s();
let precomputation_secs = start_precomputation.elapsed().as_secs_f64();

let start_online = time::precise_time_s();
let start_online = Instant::now();
let computed_amount = instance.decode_u32_online(&precomputed_hashmap).unwrap();
let end_online = time::precise_time_s();
let online_secs = start_online.elapsed().as_secs_f64();

assert_eq!(amount, computed_amount);

println!(
"16/16 Split precomputation: {:?} sec",
end_precomputation - start_precomputation
);
println!(
"16/16 Split online computation: {:?} sec",
end_online - start_online
);
println!("16/16 Split precomputation: {:?} sec", precomputation_secs);
println!("16/16 Split online computation: {:?} sec", online_secs);
}
}

0 comments on commit 66b44b4

Please sign in to comment.