aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNils O. SelÄsdal <noselasd@fiane.dyndns.org>2014-01-02 14:04:43 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-01-02 14:08:11 +0100
commit324470205860303edb6ea213fc8670b2b69a7f11 (patch)
tree7623660b16e858d8d60e09cae4b6da896248f92e /include
parentb79a148eca01ff8f101662f389b8032ea2d9a535 (diff)
utils: Greatly improve performance of osmo_hexdump routines
In the osmo-bts and libosmo-abis code the hexdump routine is used for every incoming/outgoing packet (including voice frames) and the usage of snprintf showed up inside profiles. There is a semantic change when more than 4096 characters are used. The code will now truncate at byte boundaries (and not nibbles). Code: static const int lengths[] = { 23, 1000, 52 }; char buf[4096]; int i; for (i = 0; i < 30000; ++i) char *res = osmo_hexdump(buf, lengths[i & 3]); Results: before: after: real 0m3.233s real 0m0.085s user 0m3.212s user 0m0.084s sys 0m0.000s sys 0m0.000s
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions