]> rtime.felk.cvut.cz Git - can-utils.git/commit
lib: optimize sprint_[long_]canframe()
authorOliver Hartkopp <socketcan@hartkopp.net>
Mon, 5 May 2014 20:13:38 +0000 (22:13 +0200)
committerOliver Hartkopp <socketcan@hartkopp.net>
Mon, 5 May 2014 20:13:38 +0000 (22:13 +0200)
commit4a68366bac433d9e95fb74147d68d1386d62cc0a
tree2888353f5da8ff03f5264483c5cae3548cc0c563
parent31ccf45dc401ac80269bbaa6c0d1fe352e706006
lib: optimize sprint_[long_]canframe()

Inspired by the SLCAN rework from Andre Naujoks this patch replaces the
extensive use of sprintf() with simple and efficient ASCII helpers.

valgrind/kcachegrind reported a cyle estimation of about 5.3 million cycles
before and about 1.5 million cycles after the rework (factor 3.55) for the
logging of the exact same CAN content.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
lib.c