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:
11
Cargo.lock
generated
11
Cargo.lock
generated
@ -3646,7 +3646,6 @@ dependencies = [
|
|||||||
"solana-program-runtime",
|
"solana-program-runtime",
|
||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
"solana_rbpf",
|
"solana_rbpf",
|
||||||
"time 0.3.5",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -6218,7 +6217,6 @@ dependencies = [
|
|||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
"subtle",
|
"subtle",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"time 0.1.43",
|
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -6652,15 +6650,6 @@ dependencies = [
|
|||||||
"winapi 0.3.9",
|
"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]]
|
[[package]]
|
||||||
name = "time-macros"
|
name = "time-macros"
|
||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
|
@ -18,4 +18,3 @@ solana-logger = { path = "../logger", version = "=1.10.0" }
|
|||||||
solana-program-runtime = { path = "../program-runtime", version = "=1.10.0" }
|
solana-program-runtime = { path = "../program-runtime", version = "=1.10.0" }
|
||||||
solana-sdk = { path = "../sdk", version = "=1.10.0" }
|
solana-sdk = { path = "../sdk", version = "=1.10.0" }
|
||||||
solana_rbpf = "=0.2.21"
|
solana_rbpf = "=0.2.21"
|
||||||
time = "0.3.5"
|
|
||||||
|
@ -22,8 +22,8 @@ use {
|
|||||||
fs::File,
|
fs::File,
|
||||||
io::{Read, Seek, SeekFrom},
|
io::{Read, Seek, SeekFrom},
|
||||||
path::Path,
|
path::Path,
|
||||||
},
|
|
||||||
time::Instant,
|
time::Instant,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
@ -296,7 +296,7 @@ native machine code before execting it in the virtual machine.",
|
|||||||
let duration = Instant::now() - start_time;
|
let duration = Instant::now() - start_time;
|
||||||
println!("Result: {:?}", result);
|
println!("Result: {:?}", result);
|
||||||
println!("Instruction Count: {}", vm.get_total_instruction_count());
|
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") {
|
if matches.is_present("trace") {
|
||||||
println!("Trace is saved in trace.out");
|
println!("Trace is saved in trace.out");
|
||||||
let mut file = File::create("trace.out").unwrap();
|
let mut file = File::create("trace.out").unwrap();
|
||||||
|
@ -33,8 +33,5 @@ subtle = "2"
|
|||||||
thiserror = "1"
|
thiserror = "1"
|
||||||
zeroize = { version = "1.3", default-features = false, features = ["zeroize_derive"] }
|
zeroize = { version = "1.3", default-features = false, features = ["zeroize_derive"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
time = "0.1.40"
|
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["cdylib", "rlib"]
|
crate-type = ["cdylib", "rlib"]
|
||||||
|
@ -113,7 +113,9 @@ impl Iterator for RistrettoIterator {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
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]
|
#[test]
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
@ -147,23 +149,17 @@ mod tests {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Very informal measurements for now
|
// 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 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 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);
|
assert_eq!(amount, computed_amount);
|
||||||
|
|
||||||
println!(
|
println!("16/16 Split precomputation: {:?} sec", precomputation_secs);
|
||||||
"16/16 Split precomputation: {:?} sec",
|
println!("16/16 Split online computation: {:?} sec", online_secs);
|
||||||
end_precomputation - start_precomputation
|
|
||||||
);
|
|
||||||
println!(
|
|
||||||
"16/16 Split online computation: {:?} sec",
|
|
||||||
end_online - start_online
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user