Improved benchmark
This commit is contained in:
@@ -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:?}");
|
||||||
|
}
|
||||||
@@ -104,6 +104,7 @@ fn emit_node_scope(node: &RsxNode) -> TokenStream {
|
|||||||
quote! {
|
quote! {
|
||||||
{
|
{
|
||||||
#deps_emit
|
#deps_emit
|
||||||
|
#[allow(unused_parens)]
|
||||||
r.dynamic_scope(move |scope| {
|
r.dynamic_scope(move |scope| {
|
||||||
scope.children.lock().unwrap().clear();
|
scope.children.lock().unwrap().clear();
|
||||||
for #pat in #expr {
|
for #pat in #expr {
|
||||||
|
|||||||
Reference in New Issue
Block a user