Speeding up HG?

I’ve noticed one of my HG machines starting to load and execute things slower. This machine I use to test and create HG programs on.
So my question is how can I get the speed back?
I realize disabling programs I don’t use should help. As well cleaning up modules not use should help. Is there anything else that can be done?
I thought a defrag may help but I’m using HG on a Pi and from searching that topic I see a defrag wouldn’t help a SD card.

I will watch as I have had times of slow down - I think.

I believe speed is also determined by SD card speed capability, right? So could your SD card have slowed down due to age or something?

Yes the SD card capabilities can affect speed. Age I don’t believe is so much a factor. I did create a couple of programs to free up space and memory on the SD card and that does make a bit of improvement. However I’m more interested in what can be done in HG.
Although I’ve been informed the HG module clean up isn’t 100% reliable (buggy I believe was the term) using it does help. In fact I used it to remove all modules not just those in use and then restarted the HG service. The load time did improve somewhat.

You know, I just noticed last week that in all my loading, making backups, etc., etc., ALL my scheduler & program items were active. Most I do not use. So I spent 15 minutes disabling each program not used and deleting my scheduler items no longer used. I did NOT delete the 50 or schedule items listing solar day of the year etc stuff: wonder if deleting the ones not used would speed stuff up too…

Run htop from the cli to see what processes are being used.

That shows me Mono Homegenie and Java Ha-Bridge are running but for every one HA-Bridge entry I have maybe 20 homegenie entries.
For better insight it might be better to stop Homegenie service then go to the HG folder and run mono HomeGenie.exe and watch what HG is loading and running

My HG to has been slow to load but I never realized it could be HG related until reading your post. I deleted all unused modules and re started HG and my HG now starts right up quickly.

I believe there are loads of things you can do in HG to speed things up.these are a few that worked for me.
1:Disabling logging and only use that when needed.
2:Disable and remove any program not inuse or needed.
3:Flush you modules to remove thouse you may have tried but removed from groups.
4:Delete the X10securityrf file this will get regenerated with x10 rf which you only use now.
5: Disable & remove (if possible) interfaces not in use.
6: Don’t use backgrounds for your groups.
7: keep groups small (dont have all modules in one group)
8: purge log files

I’m sure there are more things you can do in HG and will add to this as I try them if i notice any improvement.

As for things other then HG on a Pi
1:Do what @Petediscrete suggests and stop anything that is running and isn’t required.
In the raspi-config
1:disable the desktop if loading
2: In advaced settings make sure you have expanded the file system.
3: make sure your memory split for the GPU is set to 16
Outside raspi-config
1: clean up left over files from upgrades and package installs
sudo apt-get clean && sudo sudo apt-get autoremove -y
2: free up unused memory
sudo sysctl vm.drop_caches=1 && sudo sysctl vm.drop_caches=2 && sudo sysctl vm.drop_caches=3 && sync
3: if your still running Stretch consider upgrading to Buster (it realy is faster)
4: Pi boards are low power devices and anything additional plugged into it can be stealing power so we need to limit those things A pi Zero W only has one USb port unless you add a header or multiport. I found there is a way to turn off the power going to the HDMI port If your running headless you don’t need that.
5: Consider using a USB stick or USB SSD I doubt the SSD will be any better as it is limited to the speed a USB port can supply. However @Petediscrete can go into the way he done it(not sure if he is using a ZeroW with the SSD)
Here’s how you would do a USB stick (I’ve not tried this yet)
http://oskarhane.com/basic-raspberry-pi-setup-with-raspbian/