summaryrefslogtreecommitdiff
path: root/lib/json.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-01-08 16:40:49 -0500
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-01-08 16:55:36 -0500
commit08ee8e223170edc764118eb6c303ee70a702b6bd (patch)
treeb5ca4c9fc53fbc60f894e413de8e4aadf04bb816 /lib/json.c
parent4060fcc47b537d49e7801371ddedf9828c94366a (diff)
vtysh: optimize printout routine
When printing responses from a client, vtysh searches through every response it receives twice. Once is to look for the terminating sequence and the other is to translate \n to \0, which is used with the line processing callback capability. However: * There's no need to search all of the output for the terminator, we can just check the last 4 bytes. * In most scenarios we won't have a callback. Therefore we don't need to process the output and can just dump it. Together these optimizations have a significant impact on the total runtime of talkative CLI commands, such as `sh ip bgp json` which runs roughly 1000% faster when dumping 1,000,000 routes. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/json.c')
0 files changed, 0 insertions, 0 deletions