This commit almost doubles the segment rendering performance. This is accomplished by caching a lot of data like highlighting groups, moving some calculations out of loops, and by performing less function calls overall. When a width is specified the main speed improvement comes from avoiding rendering the raw segments over and over until the statusline is short enough. Instead, the raw rendering is stored as a segment property and the combined length of all these renderings is used when removing low-priority segments instead. This results in a maximum of two rendering passes. Some "less pythonic" solutions have been chosen some places for performance reasons, e.g. joining strings instead of appending and joining lists. Overall this commit appears to make the performance equal or better than the legacy vimscript implementation. Later optimizations (in particular finding another method than remove() for removing low-priority segments) may make this version of Powerline far superior both in terms of functionality and performance. |
||
---|---|---|
examples | ||
lib | ||
README.rst |