akheron / jansson

C library for encoding, decoding and manipulating JSON data
http://www.digip.org/jansson/
Other
3.05k stars 808 forks source link

Reduce strlen's in jansson internals #598

Closed Mephistophiles closed 2 years ago

Mephistophiles commented 2 years ago

Reduce the number of strlen calls in the jansson backend.

Test on my laptop (count of the instructions):

  Before:
  ❯ valgrind --tool=callgrind ./bin/test_object
  ==3105045== Events    : Ir
  ==3105045== Collected : 441453

  After:
  ❯ valgrind --tool=callgrind ./bin/test_object
  ==3144451== Events    : Ir
  ==3144451== Collected : 440597
coveralls commented 2 years ago

Coverage Status

Coverage decreased (-0.001%) to 96.234% when pulling 586b4461e6317f93903ec034739a14955a10a33e on Mephistophiles:remove_internal_strlen into eb816708811429261974fc28fbf779aaaab1d546 on akheron:master.

akheron commented 2 years ago

Merged, thanks!