Skip to content
Commit 1417d376 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Optimize minimap drawing

Minimap for me gets very slow with large documents (e.g.,
kateviewhelpers.cpp). Since I run everything with asan some slowdown is
expected but in this case it became unbearably slow i.e., visible lags
of 200+ ms on scroll and typing.

The summary of optimizations is:
- Reduce allocations as much as possible
- Reduce copying
- Reduce some function calls
- Use drawPoints api instead of drawing each point separately

Allocations are reduced by introducing a new internal api to get line
decorations. This api takes an out vector by ref so that we don't
allocate from scratch all the time.

Copies of shared pointers i.e., KTextEditor::Attribute are reduced by
modifying public api to return the attribute by ref. Not sure why
this wasn't being done as it seems like a sane thing to do.

Overall its more than 3x faster now.
parent b33f89a3
Pipeline #492449 failed with stage
in 4 minutes and 56 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment