Wireshark-commits: [Wireshark-commits] master f181756: Optimize wmem_strbuf_grow.
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Fri, 2 May 2014 14:34:52 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=f181756640f2ac6e14a2034637b00eb4faa28aee
Submitter: Anders Broman (a.broman58@xxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

f181756 by Evan Huus (eapache@xxxxxxxxx):

    Optimize wmem_strbuf_grow.
    
    As suggested by Anders, in the case of repeated calls to wmem_strbuf_append_c
    (and other functions which append very little data) the growth check was a
    substantial portion of the over-all running time. By short-circuiting the check
    in the case where growth isn't needed (as opposed to letting it fall-through
    naturally) we shave ~25% off the cost of such repeated calls in my benchmarks.
    
    The function (wmem_strbuf_grow) is inline, so the compiler should be able to
    optimize each caller individually for the short-circuit.
    
    Change-Id: I76419020f4d8fa675906eb77798969b6c61c7732
    Reviewed-on: https://code.wireshark.org/review/1467
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  34fa169   Add a new Dissector for HiSLIP
    adds  f181756   Optimize wmem_strbuf_grow.


Summary of changes:
 epan/wmem/wmem_strbuf.c |    8 ++++++++
 1 file changed, 8 insertions(+)