tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 499HTML 245JavaScript 8Markdown 71218 Definiciones

Disable super-deep benchmarks (0.1 is too slow to complete these at all) (#280)

7db11fa8752a54f39cacb5381460aff438d1824e · por Nico Burns · (hace 3 años) · padre 166279fe3 · ver el árbol en este commit

Delta semántico · 3

benches/big_tree.rs

src/lib.rs

  • cambió por dentro fn fmt

4 archivos · +39 −34

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 450ab85d2..736738ab8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,4 +1,10 @@
-on: [push, pull_request]
+on:
+  pull_request:
+  push:
+    branches:
+      - main
+      - 0.1.x
+      - 0.2.x
 
 name: Continuous integration
 
diff --git a/benches/big_tree.rs b/benches/big_tree.rs
index 47b51876e..ba3ebca87 100644
--- a/benches/big_tree.rs
+++ b/benches/big_tree.rs
@@ -58,9 +58,8 @@ fn build_deep_hierarchy(taffy: &mut Taffy, node_count: u32, branching_factor: u3
     let mut rng = ChaCha8Rng::seed_from_u64(12345);
     let mut build_leaf_node = |taffy: &mut Taffy| build_random_leaf(taffy, &mut rng);
     let mut rng = ChaCha8Rng::seed_from_u64(12345);
-    let mut build_flex_node = |taffy: &mut Taffy, children: Vec<Node>| {
-        taffy.new_node(Style::random(&mut rng), &children).unwrap()
-    };
+    let mut build_flex_node =
+        |taffy: &mut Taffy, children: Vec<Node>| taffy.new_node(Style::random(&mut rng), &children).unwrap();
 
     let tree = build_deep_tree(taffy, node_count, branching_factor, &mut build_leaf_node, &mut build_flex_node);
 
@@ -125,7 +124,7 @@ fn taffy_benchmarks(c: &mut Criterion) {
     });
 
     group.bench_function("10_000 nodes", |b| {
-       b.iter_batched(
+        b.iter_batched(
             || {
                 let mut taffy = Taffy::new();
                 let root = build_yoga_deep_hierarchy(&mut taffy, 10_000, 10);
@@ -178,7 +177,7 @@ fn taffy_benchmarks(c: &mut Criterion) {
     });
 
     group.bench_function("100 nodes (2-level hierarchy)", |b| {
-         b.iter_batched(
+        b.iter_batched(
             || {
                 let mut taffy = Taffy::new();
                 let root = build_flat_hierarchy(&mut taffy, 100);
@@ -190,7 +189,7 @@ fn taffy_benchmarks(c: &mut Criterion) {
     });
 
     group.bench_function("1_000 nodes (2-level hierarchy)", |b| {
-         b.iter_batched(
+        b.iter_batched(
             || {
                 let mut taffy = Taffy::new();
                 let root = build_flat_hierarchy(&mut taffy, 1_000);
@@ -202,7 +201,7 @@ fn taffy_benchmarks(c: &mut Criterion) {
     });
 
     group.bench_function("10_000 nodes (2-level hierarchy)", |b| {
-       b.iter_batched(
+        b.iter_batched(
             || {
                 let mut taffy = Taffy::new();
                 let root = build_flat_hierarchy(&mut taffy, 10_000);
@@ -293,32 +292,32 @@ fn taffy_benchmarks(c: &mut Criterion) {
 
     drop(group);
 
-    let mut group = c.benchmark_group("super deep trees");
-    group.sample_size(10);
+    // let mut group = c.benchmark_group("super deep trees");
+    // group.sample_size(10);
 
-    group.bench_function("100 nodes (100-level hierarchy)", |b| {
-         b.iter_batched(
-            || {
-                let mut taffy = Taffy::new();
-                let root = build_deep_hierarchy(&mut taffy, 100, 1);
-                (taffy, root)
-            },
-            |(mut taffy, root)| taffy.compute_layout(root, Size::undefined()).unwrap(),
-            criterion::BatchSize::SmallInput,
-        )
-    });
+    // group.bench_function("100 nodes (100-level hierarchy)", |b| {
+    //      b.iter_batched(
+    //         || {
+    //             let mut taffy = Taffy::new();
+    //             let root = build_deep_hierarchy(&mut taffy, 100, 1);
+    //             (taffy, root)
+    //         },
+    //         |(mut taffy, root)| taffy.compute_layout(root, Size::undefined()).unwrap(),
+    //         criterion::BatchSize::SmallInput,
+    //     )
+    // });
 
-    group.bench_function("1_000 nodes (1000-level hierarchy)", |b| {
-         b.iter_batched(
-            || {
-                let mut taffy = Taffy::new();
-                let root = build_deep_hierarchy(&mut taffy, 1_000, 1);
-                (taffy, root)
-            },
-            |(mut taffy, root)| taffy.compute_layout(root, Size::undefined()).unwrap(),
-            criterion::BatchSize::SmallInput,
-        )
-    });
+    // group.bench_function("1_000 nodes (1000-level hierarchy)", |b| {
+    //      b.iter_batched(
+    //         || {
+    //             let mut taffy = Taffy::new();
+    //             let root = build_deep_hierarchy(&mut taffy, 1_000, 1);
+    //             (taffy, root)
+    //         },
+    //         |(mut taffy, root)| taffy.compute_layout(root, Size::undefined()).unwrap(),
+    //         criterion::BatchSize::SmallInput,
+    //     )
+    // });
 }
 
 criterion_group!(benches, taffy_benchmarks);
diff --git a/src/lib.rs b/src/lib.rs
index 31ecf1998..8d661fab6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -43,7 +43,7 @@ pub enum Error {
 impl Display for Error {
     fn fmt(&self, f: &mut Formatter) -> Result {
         match *self {
-            Error::InvalidNode(ref node) => write!(f, "Invalid node {:?}", node),
+            Error::InvalidNode(ref node) => write!(f, "Invalid node {node:?}"),
         }
     }
 }
diff --git a/src/randomizable.rs b/src/randomizable.rs
index bcdf5e826..f766abfe4 100644
--- a/src/randomizable.rs
+++ b/src/randomizable.rs
@@ -52,4 +52,4 @@ impl Randomizeable for Style {
         // TODO: Add more attributes
         Style { size: Size::<Dimension>::random(rng), ..Default::default() }
     }
-}
\ No newline at end of file
+}