Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 committed Sep 24, 2023
1 parent 28f12eb commit ef8c373
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions crates/torin/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,13 @@ fn criterion_benchmark(c: &mut Criterion) {
for level in 0..depth {
for i in &children_ids {
let id = (level * size) + *i;
let children = (1..101)
.map(move |i| i + (level * size))
.collect::<Vec<usize>>();
let children = if level == depth - 1 {
vec![]
} else {
(1..101)
.map(move |i| i + ((level + 1) * size))
.collect::<Vec<usize>>()
};

mocked_dom.add(
id,
Expand Down Expand Up @@ -164,9 +168,13 @@ fn criterion_benchmark(c: &mut Criterion) {
for level in 0..levels {
for i in &children_ids {
let id = (level * 1000) + *i;
let children = (1..101)
.map(move |i| i + (level * 1000))
.collect::<Vec<usize>>();
let children = if level == levels - 1 {
vec![]
} else {
(1..101)
.map(move |i| i + ((level + 1) * 1000))
.collect::<Vec<usize>>()
};

mocked_dom.add(
id,
Expand Down Expand Up @@ -243,9 +251,13 @@ fn criterion_benchmark(c: &mut Criterion) {
for level in 0..levels {
for i in &children_ids {
let id = (level * 1000) + *i;
let children = (1..101)
.map(move |i| i + (level * 1000))
.collect::<Vec<usize>>();
let children = if level == levels - 1 {
vec![]
} else {
(1..101)
.map(move |i| i + ((level + 1) * 1000))
.collect::<Vec<usize>>()
};

mocked_dom.add(
id,
Expand Down Expand Up @@ -322,9 +334,13 @@ fn criterion_benchmark(c: &mut Criterion) {
for level in 0..levels {
for i in &children_ids {
let id = (level * 1000) + *i;
let children = (1..101)
.map(move |i| i + (level * 1000))
.collect::<Vec<usize>>();
let children = if level == levels - 1 {
vec![]
} else {
(1..101)
.map(move |i| i + ((level + 1) * 1000))
.collect::<Vec<usize>>()
};

mocked_dom.add(
id,
Expand Down

0 comments on commit ef8c373

Please sign in to comment.