Edit: Disregard. This is entirely a Firefox thing. Chrome and Edge render instantly. Firefox seems to handle up to 10000 or so lines of config without too much indigestion, but go larger and the lag time is excessive.
First and foremost, I love the UX for the new config differ. Some nice work there. For the most part it works really well. I have a few exceptions using it to pull diffs on some rather large routers with ~20,000 lines or so of config – and thousands of config deltas in git. It takes a full minute for the differ to pull config plus deltas in and render the first diff.
Any ideas on how I could optimize for better performance? Thanks!
[OK] Composer Version: 2.10.3
[OK] Dependencies up-to-date.
[OK] Database Connected
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] Database and column collations are correct
[OK] Database schema correct
[OK] MySQL and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service is enabled
[OK] Locks are functional
[OK] Python wrapper cron entry is not present
[OK] Redis is unavailable
[OK] No errors found with polling frequencies.
[OK] rrdtool version ok
[OK] Connected to rrdcached
```
Ran node_full path json through jq to get number of lines.
$ time curl 'http://x.x.x.x/node/version?node_full=99k1&format=json' | jq > ox-node-full.txt
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 942.1k 100 942.1k 0 0 5.64M 0 0
real 0m0.198s
user 0m0.036s
sys 0m0.018s
$ cat ox-node-full.txt | wc -l
29724
$ time curl -s 'http://x.x.x.x/node/fetch/ASR-9K/99k1' | wc -l
20018
real 0m0.016s
user 0m0.004s
sys 0m0.009s
So retrieval time from Oxidized is almost instant via curl.
$ time curl 'http://x.x.x.x/node/version?node_full=99k1&format=json' | jq | grep date | wc -l
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 942.1k 100 942.1k 0 0 6.05M 0 0
5404
real 0m0.184s
user 0m0.041s
sys 0m0.017s
jq with ‘grep date’ show 5404 commits for that node – and curl pulls the data in 2/10 of a second.
Edit: I’m thinking of revamping my git repos and putting them on a diet. I really don’t need four years worth of config deltas.
Edit 2: This is a Firefox issue. Diff is fast as can be using Chrome or Edge. SpiderMonkey vs V8 engine efficiency perhaps?
Quid pro quo. I was kicking myself a bit for not remembering Firefox’s javascript engine inefficiencies earlier. And yeah, some of our boxes are a little porky.