Skip to content

Text.find slows down with the number of invocations #11859

@4e6

Description

@4e6

I encountered the issue when solving Advent Of Code day 13.

I created a project reproducing the issue Text_Find_Bench.zip It contains a bench.txt file with a sequence of lines to parse:

Button A: X+46, Y+89
Button B: X+99, Y+32
Prize: X=5826, Y=7443

Button ...

Then the function parse_input parses those lines, printing how many lines is left to parse:

parse_input lines =
    go input acc =
        if input.is_empty then acc else
            p = input.take 4
            m = Main.parse_machine p
            IO.println ('lines remain: ' + input.length.to_text)
            @Tail_Call go (input.drop 4) acc+1
    go lines 0

When running the program, you can see how the lines remain output slows down with the number of lines parsed:

Text_Find_Bench.mp4

Metadata

Metadata

Labels

-language-server-libsLibraries: New libraries to be implemented

Type

No type

Projects

Status

🟢 Accepted

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions