elm-optimize-level-2/testcases/elm-ui/Suite.elm

39 lines
773 B
Elm
Raw Normal View History

module Suite exposing (suite)
2020-08-04 05:37:45 +03:00
{-| -}
2021-07-08 16:45:56 +03:00
import V8.Benchmark.Runner.Json exposing (..)
2020-08-04 05:37:45 +03:00
import Element exposing (..)
import Element.Background as Background
import Element.Font as Font
2021-07-08 16:45:56 +03:00
import V8.Debug
2020-08-04 05:37:45 +03:00
three =
List.repeat 3 0
suite : Benchmark
suite =
describe "Elm UI"
[ benchmark "create a 4 level nested Elm UI tree" <|
\_ ->
Element.layout []
(Element.column [] (List.map (viewLevels 4) three))
]
blue =
rgb 0 0 1
viewLevels level _ =
if level == 0 then
none
else
Element.row
2021-07-08 16:45:56 +03:00
[ V8.Debug.memory "font size" (Font.size 16)
, V8.Debug.memory "bg:blue" (Background.color blue)
2020-08-04 05:37:45 +03:00
]
(List.map (viewLevels (level - 1)) three)