Simplified cleanup_cursor() implementation
I hit this performance bug when I cloneda 40G NTFS partition. The actual copy was done in under 11 minutes. After that I was shocked to find that gparted would spend over 12 minutes in cleanup_cursor, pegging a CPU core. (On a quad core desktop...) Simply replacing the ustring with std::string would reduce the time to about 1.5 minutes. Still bad. Also, I didn't want to lose UTF8 awareness. So I rewrote the algorithm in 'streaming mode'. This has the (potential) drawback that locale conversions are done, but performs well and - IMHO - is a lot more readable. On a minor note: this implementation correctly handles backspaces at the start of a line.
parent
6c3129b9
Please register or sign in to comment