summaryrefslogtreecommitdiffstats
path: root/ui/ncurses/nc-lang.c
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-02-04 12:02:23 +1100
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-02-16 14:25:23 +1100
commit91143069d1a40cefd997522d85cb2d8adf1681f7 (patch)
treebda3d7e66f2c6c927309987d693585965d43bbde /ui/ncurses/nc-lang.c
parent7b67c329067af30ffd2a1dd44cd938a7ee55af56 (diff)
downloadtalos-petitboot-91143069d1a40cefd997522d85cb2d8adf1681f7.tar.gz
talos-petitboot-91143069d1a40cefd997522d85cb2d8adf1681f7.zip
ui/ncurses: Reduce unnecessary calls to redrawwin
All current *_post() methods in ui/ncurses call redrawwin() and wrefresh() together. wrefresh() updates any lines on the screen that have been marked as changed or invalid. However redrawwin() marks the entire screen as invalid unconditionally. We can reduce the amount of data written to the screen by avoiding calls to redrawwin(). Screen transitions are the primary use case of redrawwin(), where the whole screen must be invalidated to avoid stale data remaining on screen. All other 'in-screen' updates such as changes to widgets or changing focus do not require a call to redrawwin(). The most noticeable performance improvement is in nc-menu, which makes an unnecssary call to redrawwin() after every addition to the boot option menu. eg. The number of bytes written to STDOUT in the main menu: # Boot options | Before | After -------------------------------- 8 | 5488 | 1149 133 | 422454 | 4652 Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Diffstat (limited to 'ui/ncurses/nc-lang.c')
-rw-r--r--ui/ncurses/nc-lang.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/ui/ncurses/nc-lang.c b/ui/ncurses/nc-lang.c
index 0422ebb..0b87156 100644
--- a/ui/ncurses/nc-lang.c
+++ b/ui/ncurses/nc-lang.c
@@ -131,7 +131,6 @@ static int lang_screen_post(struct nc_scr *scr)
struct lang_screen *screen = lang_screen_from_scr(scr);
widgetset_post(screen->widgetset);
nc_scr_frame_draw(scr);
- redrawwin(scr->main_ncw);
wrefresh(screen->scr.main_ncw);
pad_refresh(screen);
return 0;
OpenPOWER on IntegriCloud