Skip to content

Low performance for moderately long Strings #1

@jhrcek

Description

@jhrcek

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions