[Asterisk-code-review] core: Remove ABI effects of MALLOC DEBUG. (asterisk[master])

Corey Farrell asteriskteam at digium.com
Mon Mar 5 22:26:54 CST 2018


Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/8366 )

Change subject: core: Remove ABI effects of MALLOC_DEBUG.
......................................................................


Patch Set 4:

> > I understand that but knowing the repercussions of it is a good
 > > thing.
 > 
 > I created a unit test with the above loop to generate the results
 > below.
 > I expected the patch to slow execution some because of the extra
 > function
 > call layer.  However, I frequently saw reported execution times
 > with and
 > without the patch being consistently about a second higher.  It
 > made it
 > very difficult to get believable results to compare with and
 > without the
 > patch when I compiled it one way and it returned higher times than
 > the
 > last time.

I ran the test as well but with DONT_OPTIMIZE and MALLOC_DEBUG disabled.  My results were pretty consistent between iterations in each configuration so I'm only posting the total runtimes:

   Without patch: 8874ms with the test in main/asterisk.c, 9028ms with the test in a module.
 With this patch: 8918ms with the test in main/asterisk.c, 9290ms with the test in a module.
With my followup: 9345ms with the test in main/asterisk.c, 9409ms with the test in a module.

This means 100 million pairs of calls to ast_malloc/ast_free will take 50-250ms longer with Richard's patch, 400-500ms longer when my followup is included.  I'm unsure why my patch causes the runtime to increase, it actually eliminates an extra function call layer.  This leads me to wonder if optimization is bypassing the __ast_repl_malloc function in Richard's patch and causing it to be inlined.


-- 
To view, visit https://gerrit.asterisk.org/8366
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic07ad80b2c2df894db984cf27b16a69383ce0e10
Gerrit-Change-Number: 8366
Gerrit-PatchSet: 4
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Tue, 06 Mar 2018 04:26:54 +0000
Gerrit-HasComments: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180305/f67f62ef/attachment.html>


More information about the asterisk-code-review mailing list