I'm working on an application that uses /ip/route/print through the RouterOS API to gather some routing table data. The performance of this operation is really bad, and it seems to diminish geometrically as routing table size increases. For example, on the command line the following command is basically instantaneous:
/ip route print detail where bgp=yes dst-address=192.168.0.0/20
But doing the similar command using the API on a CCR 1016 takes 35 seconds on one box, and 150s on another (which carries a larger routing table).
I speculate that there is an implementation difference between the command line and the API that causes the former to efficiently filter the data while the latter does a scan of the whole table.
Any thoughts or ideas?