-
Notifications
You must be signed in to change notification settings - Fork 0
Reduce calls to ruler function #9
Copy link
Copy link
Open
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels