[ovs-dev] [PATCH v2] ovn-controller: optimize lex_token memory usage
Ben Pfaff
blp at ovn.org
Thu Mar 31 15:16:47 UTC 2016
On Thu, Mar 31, 2016 at 03:37:56PM +0800, Huang Lei wrote:
> From: Huang Lei <lhuang8 at ebay.com>
>
> During our scalability test '2k HVs + 20k lports' we found that lexer is a
> major user of heap memory:
> - 5.22% ovn-controller libjemalloc.so.1 [.] free
> - free
> + 27.46% lexer_get
> + 18.00% ofctrl_put
> ...
> - 1.85% ovn-controller libjemalloc.so.1 [.] malloc
> - malloc
> - xmalloc
> - 55.03% xmemdup0
> - 90.58% lex_parse_id.isra.0
> - lexer_get
> ...
>
> So lex_token is modified to usage a 'buffer' defined in it for tokens smaller
> than 128 bytes, and for tokens bigger than 128 bytes it turn to use heap
> memory. This change makes our test case run at least 10% faster.
>
> Tested with 'ovn -- lexer' case.
>
> Signed-off-by: Huang Lei <lhuang8 at ebay.com>
Thanks. I tweaked a lot of details of the code and pushed this to
master.
More information about the dev
mailing list