bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

avoiding 'static inline'


From: Paul Eggert
Subject: avoiding 'static inline'
Date: Sat, 18 Aug 2012 17:50:19 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0

I recently added a bunch of static inline functions to Emacs,
and just for fun I tried changing them to plain 'static' to
see how much that would hurt performance.  To my surprise, it
made Emacs 14% faster on my standard Lisp benchmark (taking the nth
element of a long list).  It also shrank the size of the text segment
by 1.7%, which was not as much of a surprise.

Clearly I've been using 'static inline' too much.  Come to think of
it, these days there's little need for 'static inline' as opposed to
'static', since GCC and other modern compilers will inline 'static'
functions for you.  And apparently they do a better job if they're not
given bad advice by people who use the 'inline' keyword.

I'd like to install some changes to gnulib, so that its code does
not use 'static inline' in the modules that Emacs uses.  This is part
of a similar, larger change to Emacs proper.  These patches won't
affect extern inline functions, just static ones.

There are more opportunities for changes like this to gnulib, but
I thought I'd do these first and ask for comments.

The patches themselves will be in followup messages.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]