Skip to content

Commit

Permalink
More CPU effective logs view
Browse files Browse the repository at this point in the history
Previously it takes too much CPU due to constantly updating self.rows
and self.content, because the SizeCache that was used, works
differently, the cache matches only if the sizes (x, y) are equal, while
we always have Y (number of rows in the logs) > y (size of the screen).

Also previously rendering of LogEntry depends on the highlighting,
remove this, and highlight the whole row ("row" not "line"), that makes
search (including incremental) way more faster - since it does not
requires to update self.content or self.rows, just search for a new row
and draw it differently.

It is not as effective as less(1) anyway, but something at least
magnitude better then it was.

And since server logs had been added the performance of the logs view
became crucial.
  • Loading branch information
azat committed Apr 1, 2024
1 parent b93875b commit 6342e47
Show file tree
Hide file tree
Showing 2 changed files with 176 additions and 172 deletions.
Loading

0 comments on commit 6342e47

Please sign in to comment.