Skip to content

Reduce calls to ruler function #9

@StarScape

Description

@StarScape

Currrently the function returned by (ruler) gets called a lot in the viewmodel layer. This is laziness on my part as it simply re-recalls (measure) a bunch of times with the same or slightly different text when doing the line-splitting, rather than cacheing the old value, measuring the width of the next word, and then measuring it.

It doesn't currently seem to be a performance problem currently, but it is rather disturbing to see a function getting called ~5000 times for a trivial rendering example, even if that function is only measuring the width of a single character.

Something to keep in mind for the future, just make sure there's actually a measurable performance difference.

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