]> granicus.if.org Git - procps-ng/commit
top: for performance, employ additional inlining
authorJim Warner <james.warner@comcast.net>
Fri, 5 Oct 2012 20:15:15 +0000 (15:15 -0500)
committerCraig Small <csmall@enc.com.au>
Thu, 11 Oct 2012 10:13:14 +0000 (21:13 +1100)
commite77c8e8cf0428ed5f3498ba8b06b1936ab7c955c
tree481903ec7a5ac8eb81b14b9c3d5e667dc7e317ec
parentf00541197400e8a70649300aa1faaac56a972edb
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>
top/top.c
top/top.h