Skip to content

Commit

Permalink
Bump time dependency to 0.3 (#22)
Browse files Browse the repository at this point in the history
* Bump time dependency to 0.3

* downgrade time for rust 1.63.0 in ci
  • Loading branch information
jelmer authored Aug 13, 2023
1 parent a8892be commit 9e16a09
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ jobs:
profile: minimal
override: true

- name: downgrade 'time' for Rust 1.63.0
uses: actions-rs/cargo@v1
with:
command: update
args: --package time --precise 0.3.20
if: ${{ matrix.rust == '1.63.0' }}

- name: Build generator
uses: actions-rs/cargo@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = ["Huon Wilson <dbau.pp@gmail.com>"]
unstable = []

[dependencies]
time = "0.1.10"
time = "0.3"
log = "0"
getopts = "0.2.21"
rand = "0.8.5"
9 changes: 4 additions & 5 deletions generator/src/phf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,18 @@ pub fn create_phf(
max_tries: usize,
) -> (u64, Vec<(u32, u32)>, Vec<char>) {
let mut rng = StdRng::seed_from_u64(0xf0f0f0f0);
let start = time::precise_time_s();
let start = time::Instant::now();

for i in 0..(max_tries) {
let my_start = time::precise_time_s();
let my_start = time::Instant::now();
println!("PHF #{}: starting {:.2}", i, my_start - start);

let seed = rng.gen();
if let Some((disp, map)) = try_phf_table(data, lambda, seed, &mut rng) {
let end = time::precise_time_s();
println!(
"PHF took: total {:.2} s, successive {:.2} s",
end - start,
end - my_start
start.elapsed(),
my_start.elapsed()
);
return (seed, disp, map);
}
Expand Down

0 comments on commit 9e16a09

Please sign in to comment.