diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index 3c7fb4cb17..0b5f81ccb0 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -4807,14 +4807,13 @@ DEFUN(show_bgp_l2vpn_evpn_route, evpn_show_all_routes(vty, bgp, type, json, detail); - if (uj) { - if (detail) { - vty_out(vty, "%s\n", json_object_to_json_string(json)); - json_object_free(json); - } else { - vty_json(vty, json); - } - } + /* + * This is an extremely expensive operation at scale + * and as such we need to save as much time as is + * possible. + */ + if (uj) + vty_json_no_pretty(vty, json); return CMD_SUCCESS; }