From f8e31fa9221b57f527adb6d0bcd3a9a03ed4393f Mon Sep 17 00:00:00 2001 From: 1000000000 Date: Thu, 1 Apr 2021 22:11:36 -0400 Subject: [PATCH] Added some documentation for the optimization --- notes/transformations.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/notes/transformations.md b/notes/transformations.md index b841602..aa19921 100644 --- a/notes/transformations.md +++ b/notes/transformations.md @@ -459,3 +459,13 @@ It's pretty common to put things in a tuple (or threeple) to start a case statem ``` We could skip allocating the tuple though. + +# String Joining + +For joining (and concating) strings, Elm uses Javascript's Array join method after converting the list into a Javascript array. +We can replace this implementation with a faster one that traverses the list and builds the string through concatenation instead. + +## Results Summary + +* Not included in elm-optimize-level-2 tool +* The implementation used is similar to the improved String.join implementation [here](https://gitlab.com/e-neighborhood-watch/elm-string-benchmarks/#stringjoin) which sees some serious improvements over Elm's normal String.join.