Skip to content

Commit

Permalink
update benches from iMac
Browse files Browse the repository at this point in the history
  • Loading branch information
azizkayumov committed Nov 6, 2023
1 parent f37a017 commit 39a3cb0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ The overall running time for performing a number of random operations (`link(v,

| # Nodes | # Operations | [lctree](https://github.com/azizkayumov/lctree/blob/main/src/lctree.rs) | [brute-force](https://github.com/azizkayumov/lctree/blob/main/benches/benchmark.rs) |
| :--- | :--- | :--- | :--- |
| 100 | 10K | 4.8973 ms | 18.992 ms |
| 200 | 20K | 11.175 ms | 74.780 ms |
| 500 | 50K | 31.590 ms | 471.71 ms |
| 1000 | 1M | 699.00 ms | 19.608 s |
| 5000 | 5M | 4.5047 s | 500.04 s |
| 100 | 10K | 4.8161 ms | 18.013 ms |
| 200 | 20K | 11.091 ms | 69.855 ms |
| 500 | 50K | 31.623 ms | 429.53 ms |
| 1000 | 100K | 68.649 ms | 1.8746 s |
| 5000 | 500K | 445.83 ms | 46.854 s |

## Credits
This crate applies the core concepts and ideas presented in the following sources:
Expand Down
10 changes: 5 additions & 5 deletions benches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ The overall running time for performing a number of random operations (`link(v,

| # Nodes | # Operations | Random seed | [lctree](https://github.com/azizkayumov/lctree/blob/main/src/lctree.rs) | [brute-force](https://github.com/azizkayumov/lctree/blob/main/benches/benchmark.rs) |
| :--- | :--- | :--- | :--- | :--- |
| 100 | 10K | 0 | 4.8973 ms | 18.992 ms |
| 200 | 20K | 1 | 11.175 ms | 74.780 ms |
| 500 | 50K | 2 | 31.590 ms | 471.71 ms |
| 1000 | 1M | 3 | 699.00 ms | 19.608 s |
| 5000 | 5M | 4 | 4.5047 s | 500.04 s |
| 100 | 10K | 0 | 4.8161 ms | 18.013 ms |
| 200 | 20K | 1 | 11.091 ms | 69.855 ms |
| 500 | 50K | 2 | 31.623 ms | 429.53 ms |
| 1000 | 100K | 3 | 68.649 ms | 1.8746 s |
| 5000 | 500K | 4 | 445.83 ms | 46.854 s |

The following table includes worst-case time complexity analysis of each operation for the brute-force solution and Link-cut-trees:

Expand Down
4 changes: 2 additions & 2 deletions benches/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ use std::collections::{HashMap, HashSet};

fn benchmark(criterion: &mut Criterion) {
let num_nodes = [100, 200, 500, 1000, 5000];
let num_operations = [10_000, 20_000, 50_000, 1_000_000, 5_000_000];
let num_operations = [10_000, 20_000, 50_000, 100_000, 500_000];
let seeds: [u64; 5] = [0, 1, 2, 3, 4];

// The last two benchmarks are very slow with the brute force,
// so we only run smaller samples:
for i in 0..3 {
for i in 0..5 {
let mut group = criterion.benchmark_group(format!("forest_{}", num_nodes[i]).as_str());
group.sample_size(10);

Expand Down

0 comments on commit 39a3cb0

Please sign in to comment.