Use config_tree diff instead of relying on legacy backend 'loadFile'.
Update: separating out the legacy diff algorithm requires relying on the cli_app functions 'my_set'/'my_delete' to re-insert the proposed config withing the legacy cstore structure --- this incurs a performance penalty ~3 times slower than the legacy loadFile. Two things to be clear on: (1) this experiment never pertained to config load on boot; that is a different mechanism; (2) the performance hit is due to moving to 'my_set'/'my_delete', not the diff algorithm itself.
Regarding (2), an experiment with batch set/delete operations:
https://github.com/vyos/vyatta-cfg/compare/current...jestabro:vyatta-cfg:cli_batch
gives negligible improvement, for an obvious reason: the one thing that the legacy diff algorithm does is produce internal Cpath structures representing set/delete commands; rebuilding those, even in batch operations, is time-consuming.
By contrast the replacement config diff algorithm is general, producing full trees which are needed for recursive diff utilities; to define a fundamental data structure for general use; and to produce generic set/delete commands for a cli.
The design of the config_tree diff algorithm takes an arbitrary diff function as argument, so the possibility of a legacy interface to mimic the construction of Cpath's is open, but for now, this work is on hold, in favor of:
(1) parse the output of loadFIle in order to address the missed errors discussed in T4382.
(2) Replace PR
https://github.com/vyos/vyos-1x/pull/1328
with just the first two commits that cover, respectively, clean up of component version IO; rewrite of save-config.