chore: remove time dep (#22665)

* 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](https://github.com/time-rs/time/compare/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>
This commit is contained in:
dependabot[bot] 2022-01-25 16:30:21 -07:00 committed by GitHub
parent 8b1cde83c1
commit 66b44b48a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 30 deletions

11
Cargo.lock generated
View File

@ -3646,7 +3646,6 @@ dependencies = [
"solana-program-runtime",
"solana-sdk",
"solana_rbpf",
"time 0.3.5",
]
[[package]]
@ -6218,7 +6217,6 @@ dependencies = [
"solana-sdk",
"subtle",
"thiserror",
"time 0.1.43",
"zeroize",
]
@ -6652,15 +6650,6 @@ dependencies = [
"winapi 0.3.9",
]
[[package]]
name = "time"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41effe7cfa8af36f439fac33861b66b049edc6f9a32331e2312660529c1c24ad"
dependencies = [
"libc",
]
[[package]]
name = "time-macros"
version = "0.1.1"

View File

@ -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"

View File

@ -22,8 +22,8 @@ use {
fs::File,
io::{Read, Seek, SeekFrom},
path::Path,
time::Instant,
},
time::Instant,
};
#[derive(Serialize, Deserialize, Debug)]
@ -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();

View File

@ -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"]

View File

@ -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)]
@ -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);
}
}