Reduce memory allocation overhead in update generation code
Note that pugixml library allocates memory for a document in increments
of 32KB pages and then manages smaller allocations (nodes or attributes)
using these pages. Calling the reset method on a document frees all the
pages. Hence a 32B page allocation/free happens for each config message
sent to a client. Instead, removing the only child node of the document
ensures that pugixml does only a single 32KB allocation per document and
recycles the same memory when building the tree for each message.
Reviewed: https:/ /review. opencontrail. org/24213 github. org/Juniper/ contrail- controller/ commit/ ffd723e4b991064 f406d7e2644d67f 8f76a193f2
Committed: http://
Submitter: Zuul
Branch: master
commit ffd723e4b991064 f406d7e2644d67f 8f76a193f2
Author: Nischal Sheth <email address hidden>
Date: Fri Sep 16 09:09:36 2016 -0700
Reduce memory allocation overhead in update generation code
Note that pugixml library allocates memory for a document in increments
of 32KB pages and then manages smaller allocations (nodes or attributes)
using these pages. Calling the reset method on a document frees all the
pages. Hence a 32B page allocation/free happens for each config message
sent to a client. Instead, removing the only child node of the document
ensures that pugixml does only a single 32KB allocation per document and
recycles the same memory when building the tree for each message.
Change-Id: Id56d5ad6c45fc2 b6bedfe402d4758 b454efc183e
Partial-Bug: 1602347