Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
albertwoo committed Feb 19, 2022
1 parent a483bb8 commit 581c0b7
Show file tree
Hide file tree
Showing 6 changed files with 256 additions and 257 deletions.
23 changes: 15 additions & 8 deletions Benchmark/BenchmarkV2/BasicBenchmark/CEComponent.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ type CEComponent() =


override _.Render() =
let counter =
fragment {
p {
class' "class"
$"Count = {count}"
}
button {
onclick (fun _ -> increase ())
"Increase"
}
}

div {
class' "class"
style' "color: red;"
Expand Down Expand Up @@ -46,13 +58,8 @@ type CEComponent() =
class' "class"
"p6"
}
p {
class' "class"
$"Count = {1}"
}
button {
onclick (fun _ -> increase ())
"Increase"
}
// Declare a variable help fsharp to have better inline which can save a lot of allocation for delegate
// In this benchmark it can save 40%
counter
}
}
21 changes: 13 additions & 8 deletions Benchmark/BenchmarkV2/BasicBenchmark/CEFelizComponent.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ type CEFelizComponent() =


override _.Render() =
let counter =
fragment {
p {
attr.className "class"
attr.childContent $"Count = {count}"
}
button {
attr.onclick (fun _ -> increase ())
attr.childContent "Increase"
}
}

div {
attr.className "1"
attr.style "color: red;"
Expand Down Expand Up @@ -46,13 +58,6 @@ type CEFelizComponent() =
attr.className "class"
attr.childContent "p"
}
p {
attr.className "class"
attr.childContent $"Count = {count}"
}
button {
attr.onclick (fun _ -> increase ())
attr.childContent "Increase"
}
counter
}
}
Loading

0 comments on commit 581c0b7

Please sign in to comment.