[ovs-git] [openvswitch/ovs] f48e86: ovn-controller: Optimize lex_token memory usage.

GitHub noreply at github.com
Thu Mar 31 15:16:35 UTC 2016

  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: f48e869e6077fb023ad10eccf68d718b3ba0e9f0
  Author: Huang Lei <lhuang8 at ebay.com>
  Date:   2016-03-31 (Thu, 31 Mar 2016)

  Changed paths:
    M ovn/lib/lex.c
    M ovn/lib/lex.h

  Log Message:
  ovn-controller: Optimize lex_token memory usage.

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 256 bytes, and for tokens bigger than 256 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>
[blp at ovn.org tweaked many details]
Signed-off-by: Ben Pfaff <blp at ovn.org>

More information about the git mailing list