Skip to content

Implement stricter O(n) solution #5

Description

@HenryByte

At the moment there's a lot of copying and duplicate iteration done, for instance the sanitization iterates through all rows before even starting, along with the newly added trimming of white lines:

source: list[str] = list(itertools.dropwhile(lambda s: s.strip() == "", source))

source: Generator[str, Any, None] = (_preprocess_line(line) for line in source)

This can easily be optimized away by iterating through the lines, though it creates more complex code, it will speed things up.

Two things to do:
[] Create a performance test
[] Implement new flow using single loop

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