]> git.puffer.fish Git - mirror/frr.git/commit
lib/cli: reduce strcmp in CLI hot paths
authorDavid Lamparter <equinox@opensourcerouting.org>
Tue, 5 May 2015 09:10:20 +0000 (11:10 +0200)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 8 Jun 2016 18:35:38 +0000 (14:35 -0400)
commitc117e02796a8c1d32379b9eb2e7c444fdeeb60d6
tree7aea4dfa37eef2066be52e9b10a8cac286bba4fa
parentc0d8db4d9eb556921ef1c40078c740596f1e139b
lib/cli: reduce strcmp in CLI hot paths

Er, no idea how anyone could ever have thought that it would be a good
idea to have a zillion of strcmp() calls in the CLI's active paths, just
to compare against things like "A.B.C.D".

Reduces 40k prefix list load time from 1.65s to 1.23s (1.34:1).

Acked-by: Paul Jakma <paul@jakma.org>
[v2: killed CMDS_* macros]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 10bac80195cf5a781da6e4415e6580fd7080f734)
lib/command.c
lib/command.h