JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
copy dirty lines to screen, add select() timeout & min time between draw() calls.
authorAurélien Aptel <aurelien.aptel@gmail.com>
Sat, 21 Jan 2012 22:14:41 +0000 (23:14 +0100)
committerAurélien Aptel <aurelien.aptel@gmail.com>
Sat, 21 Jan 2012 22:14:41 +0000 (23:14 +0100)
commit896310e5928b6daab5f594acd9648ffe8233022e
tree5f76ce8a7e3090c7e88edeb155f5e5755faebf4e
parent13a8eeb810ccfdaefd58c52328dd0ec867e3ae8d
copy dirty lines to screen, add select() timeout & min time between draw() calls.

* add a timeout value (SELECT_TIMEOUT) of 20ms in the select() call
* wait at least 20ms (DRAW_TIMEOUT) between draw() calls
* only copy dirty lines from the buffer to the screen

what draw() does:
* clears dirty lines in the buffer
* draws the longest same-attributes string of each
  dirty line to the buffer with multiple xdraws() call
* copies the current dirty line from buffer to the screen with a single
  xcopy() call

this changeset makes st run ~10x faster.
st.c