Improved benchmark

This commit is contained in:
2026-01-30 17:15:12 +01:00
parent 41f4ad1022
commit c9a7e3c835
2 changed files with 26 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
use std::sync::Arc;
use osui::prelude::*;
pub fn main() {
let engine = Benchmark::new(Console::new());
let mut benchmark_result = Vec::new();
for items in 0..10 {
benchmark_result.push(
engine
.run(move |cx| {
rsx! {
for _ in (0..items) {
"Hello, world!"
}
}
.view(cx.clone())
})
.expect("Failed to run engine"),
);
}
println!("{benchmark_result:?}");
}
+1
View File
@@ -104,6 +104,7 @@ fn emit_node_scope(node: &RsxNode) -> TokenStream {
quote! {
{
#deps_emit
#[allow(unused_parens)]
r.dynamic_scope(move |scope| {
scope.children.lock().unwrap().clear();
for #pat in #expr {