[ovs-dev] [PATCH 2/3] ofproto: Cache result in dp_enumerate_type

Ben Pfaff blp at nicira.com
Tue Jan 22 18:10:29 UTC 2013

On Mon, Jan 21, 2013 at 03:10:01PM +0900, Simon Horman wrote:
> It is not clear to me that the result calculated by dp_enumerate_type()
> can ever change.
> By caching the lookup made by dp_enumerate_types() calls to
> shash_add() and shash_destroy() destroy are avoided reducing the use of
> malloc(), free() and hash_bytes().
> In my test environment this increased the rate at which packets could be
> received from ~24.4kpps to ~25.6kpps.
> Signed-off-by: Simon Horman <horms at verge.net.au>

Seems reasonable.  I am surprised that it made a difference in
performance; I've never seen a measurable performance difference from
similar patches I've tried out myself.

dp_enumerate_types() needs a comment update.



More information about the dev mailing list