]> git.proxmox.com Git - mirror_frr.git/commit
lib: Increase stream allocation speed.
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 2 Aug 2018 17:42:15 +0000 (13:42 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 2 Aug 2018 18:57:44 +0000 (14:57 -0400)
commit565b5561acffc598b8ef8b99a7e6fb77e37f9257
tree94407272903094c68d9e96edd5b23348df8e2bfc
parent25f5f0398766e756fccb562dda7b0d55b86fe7ea
lib: Increase stream allocation speed.

Modify stream_new in this way:

1) ALLOC allocations do not fail, they cause a crash so remove
if tests for it.

2) Modify usage of XCALLOC to XMALLOC and then hand set all the
relevant data in the stream pointer.

With this modification stream allocation of 10000000 streams at
10k bytes each reduced from on average 1.43 seconds to 0.65 seconds.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/stream.c