walles / moar

Moar is a pager. It's designed to just do the right thing without any configuration.
Other
647 stars 18 forks source link

Avoid tokensFromString() calls #36

Closed walles closed 3 years ago

walles commented 3 years ago

In profiling, tokensFromString() turns up hot when I mouse scroll vigorously up and down.

Currently, our Readers provide strings.

What they should provide is Lines.

A Line should be initialised using a string, and should implement Tokens() and PlainString().

The Line should do the tokenisation on demand, cache it when done and throw away the original string after it has been tokenised.

This should improve scrolling-up-and-down performance without too much work.