Elm Exactly
Results / elm-bytes /

EncodeLargeSequenceTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`Bytes.Encode.sequence` of 100 `unsignedInt8` encoders produces 100 bytes.

The test encodes a list of 100 zero bytes and logs the width of the result.

Results

elm-0.19.1

passran in 46 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
EncodeLargeSequenceTest: 100

elm-0.19.2

passran in 58 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
EncodeLargeSequenceTest: 100

elm-0.19.3

passran in 58 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
EncodeLargeSequenceTest: 100

lamdera-1.5.0

passran in 61 ms
Output
EncodeLargeSequenceTest: 100

Discussions

Discuss this test·Search the discussions on GitHub

Discussions are on GitHub; one about this test has [t:elm-bytes/EncodeLargeSequenceTest] in its title.

Source

The -- CHECK: lines give the expected output.

module EncodeLargeSequenceTest exposing (main)
{-| `Bytes.Encode.sequence` of 100 `unsignedInt8` encoders produces 100 bytes.
The test encodes a list of 100 zero bytes and logs the width of the result.
-}
-- CHECK: EncodeLargeSequenceTest: 100
import Bytes exposing (Bytes)
import Bytes.Encode as E
import Html exposing (text)
main =
let
encoders =
List.repeat 100 (E.unsignedInt8 0)
bytes =
E.encode (E.sequence encoders)
result =
Bytes.width bytes
_ =
Debug.log "EncodeLargeSequenceTest" result
in
text (String.fromInt result)