erwald/elm-edit-distance

Low performance for moderately long Strings

jhrcek opened this issue · 0 comments

The library gives unacceptable performance for even moderately long strings. Try the following code

module Main exposing (..)

import EditDistance
import Html exposing (Html, div, text)


main : Html Never
main =
    Html.div []
        [ text <|
            toString <|
                EditDistance.levenshteinFromStrings
                    "_111111111100000000001111111111000000000011111111110000000000"
                    "111111111100000000001111111111000000000011111111110000000000"
        ]

Compiling this with elm make Main.elm and opening the resulting index.html in the browser spins up the CPU to 100% and never finishes. Can you please check that? If I remove the '_' char from the first string I get the result immediately.