top: for performance, employ additional inlining
The 'refactor and enhance column width management' recent redesign produced many subsequent benefits, the latest of which is automatically sized fixed-width non-scalable columns. As expected, there was a cost associated with these many enhancements. That cost has now been identified as a 1-4% performance degradation, depending on which fields are being displayed. This increased cost arises principally from current drawing related function calls, whereas top-3.3.3 did most of its drawing via macros effectively inlining those duties. This commit inlines the equivalent drawing functions, thus eliminating the function call penalty, and places this top on a par with top-3.3.3. The trade off is a modest additional 4k in executable size. Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
@ -612,10 +612,10 @@ typedef struct WIN_t {
|
||||
//atic inline int user_matched (WIN_t *q, const proc_t *p);
|
||||
/*------ Basic Formatting support --------------------------------------*/
|
||||
//atic inline const char *justify_pad (const char *str, int width, int justr);
|
||||
//atic const char *make_chr (const char ch, int width, int justr);
|
||||
//atic const char *make_num (long num, int width, int justr, int col);
|
||||
//atic const char *make_str (const char *str, int width, int justr, int col);
|
||||
//atic const char *scale_pcnt (float num, int width, int justr);
|
||||
//atic inline const char *make_chr (const char ch, int width, int justr);
|
||||
//atic inline const char *make_num (long num, int width, int justr, int col);
|
||||
//atic inline const char *make_str (const char *str, int width, int justr, int col);
|
||||
//atic inline const char *scale_pcnt (float num, int width, int justr);
|
||||
//atic const char *scale_tics (TIC_t tics, int width, int justr);
|
||||
//atic const char *scale_unum (unsigned long num, int type, int width, int justr);
|
||||
/*------ Fields Management support -------------------------------------*/
|
||||
|
Reference in New Issue
Block a user