on master help sign in
fix conversions in benches.rs and re-enable multiple bench sizes as issue was fixed in criterion
5b02cf8ldesgoui
benches/benches.rs+5−18
@@ -13,6 +13,7 @@ use dodrio::{
13 CachedSet, Node, Render, RenderContext, Vdom,
13 CachedSet, Node, Render, RenderContext, Vdom,
14};
14};
15use std::cell::RefCell;
15use std::cell::RefCell;
16+use std::convert::TryInto;
16
17
17/// The simplest thing we can render: `<div/>`.
18/// The simplest thing we can render: `<div/>`.
18struct Empty;
19struct Empty;
@@ -73,16 +74,9 @@ fn criterion_benchmark(c: &mut Criterion) {
73 })
74 })
74 }
75 }
75 },
76 },
76− vec![
77− // TODO: Only test one `n` value until
78− // https://github.com/bheisler/criterion.rs/issues/269 is fixed.
79− //
80− // 100,
81− // 1_000,
82− 10_000,
77+ vec![100, 1_000, 10_000],
83− ],
84 )
78 )
85− .throughput(|n| Throughput::Elements(*n as u32)),
79+ .throughput(|n| Throughput::Elements((*n).try_into().unwrap())),
86 );
80 );
87
81
88 c.bench(
82 c.bench(
@@ -96,14 +90,7 @@ fn criterion_benchmark(c: &mut Criterion) {
96 black_box(&vdom);
90 black_box(&vdom);
97 })
91 })
98 },
92 },
99− vec![
100− // TODO: Only test one `n` value until
101− // https://github.com/bheisler/criterion.rs/issues/269 is fixed.
102− //
103− // 100,
104− // 1_000,
105− 10_000,
93+ vec![100, 1_000, 10_000],
106− ],
107 )
94 )
108 .with_function("empty-to-full-list-to-empty", |b, &n| {
95 .with_function("empty-to-full-list-to-empty", |b, &n| {
109 b.iter(|| {
96 b.iter(|| {
@@ -123,7 +110,7 @@ fn criterion_benchmark(c: &mut Criterion) {
123 black_box(&vdom);
110 black_box(&vdom);
124 })
111 })
125 })
112 })
126− .throughput(|n| Throughput::Elements(*n as u32)),
113+ .throughput(|n| Throughput::Elements((*n).try_into().unwrap())),
127 );
114 );
128}
115}
129
116
src/change_list/traversal.rs+1−1
@@ -167,7 +167,7 @@ mod tests {
167
167
168 #[test]
168 #[test]
169 fn test_traversal() {
169 fn test_traversal() {
170− fn t<F>(f: F) -> Box<FnMut(&mut Traversal)>
170+ fn t<F>(f: F) -> Box<dyn FnMut(&mut Traversal)>
171 where
171 where
172 F: 'static + FnMut(&mut Traversal),
172 F: 'static + FnMut(&mut Traversal),
173 {
173 {