[SLOF] [PATCH v2 0/2] fbuffer: Improve the speed of the cursor drawing

David Gibson david at gibson.dropbear.id.au
Fri Jul 31 15:25:01 AEST 2015

On Thu, Jul 30, 2015 at 02:56:31PM +0200, Thomas Huth wrote:
> Greg Kurz recently already did a great work by introducing the
> invert-region helpers to speed up the drawing of the cursor.
> This made the grub2 command prompt and editor mode usable.
> However, the editor mode of grub2 is still sluggish - because
> grub2 always redraws the whole line (with cursor enabled!) when
> you enter a character, and since cursor and character drawing
> is still not super-fast in SLOF, this sums up to a noticable delay.
> So I tried to speed up the drawing a little bit and came up
> with the following patches. I've used a little "benchmark"
> in Forth to see how the patches improve the drawing:
>  1 buffer: etest-buf
>  : etest
>    erase-screen
>    41 etest-buf c!
>    1b emit 5b emit [char] H emit
>    cursor-on
>    milliseconds
>     20 0 do 3a 0 do etest-buf 1 terminal-write drop loop cr loop
>    milliseconds
>    swap -
>    ." Duration: " .d ." ms" cr
>  ;
> Without my patches, the etest function takes 1.8 s to draw.
> With the first patch applied, the function take ca. 1.2 s.
> With both patches applied, the function only takes ca. 0.8 s !
> The first patch changes invert-region to use a bigger
> access width if possible. And the second patch simply
> decreases the size of the cursor from a full-character
> size rectangle to an underscore-like cursor instead...
> not sure whether this is acceptable, but at least I
> think it looks as good as the original cursor.

The idea looks good to me - I don't know enough Forth to actually
review the patches though.

David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/slof/attachments/20150731/ed52db09/attachment.sig>

More information about the SLOF mailing list