* [PATCH 0/7] Initialize flowi4 objects more efficiently.
@ 2011-04-01 0:12 David Miller
0 siblings, 0 replies; only message in thread
From: David Miller @ 2011-04-01 0:12 UTC (permalink / raw)
To: netdev
When you do an initialization of an on-stack object such as:
struct foo x = { .member1 = bar, .member2 = baz };
GCC will emit a memset of the object, then fill in the parameters you
specify explicitly.
When the majority of the structure is being set explicitly, the memset
is basically unnecessary overhead. Emitting explicit stores to fill
in the zeros would be much cheaper, as well as avoid the function call
to memset.
Fix this for the cases which initialize most of the flowi4 object.
I therefore left alone cases such as:
struct flowi4 fl4 = { .daddr = daddr };
Since not only would any gains be minimal, we'd get code bloat and
much of such cases are also in the slow paths.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-04-01 0:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-01 0:12 [PATCH 0/7] Initialize flowi4 objects more efficiently David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox