I had a discussion with a HG user on PM the other day about my Advanced Smart Lights code to help him get things set up. When everything was working correctly, he noticed that there was a large delay (or at least perceived delay) from the time a motion detector sensed motion and when the light turned on. Part of this is due to X10 protocol being utilized. The other part is HG overhead. This got me thinking that maybe some systems run faster than others and that it might be nice to know what kind of a performance hit might be experienced by using a Raspberry Pi versus a 12 core PC.
To understand this, I thought a simple test that could be easily run on multiple systems would be useful. I was hoping that a few people with different systems could run the attached code and post the mono output. I have attached an example of my output for reference.
To use the hgx script:
- download script (hgx)
- go to configure->automation->[any group]
- actions->import
- select new script and edit
- select program tab and compile (upper left)
- select back to exit the script
- select the script again
- enter the name of a module that you want to test with (ideally a switch, light, dimmer)
- control the module with either RF, PLC, or HG itself
For reference:
The script will watch for a module with the given name to turn on. When it sees that command, it will immediately turn it off. I don't even have a module hooked up to actuate, I just used address A1. With the official release of HG (not using the updated XTenLib posted yesterday), the command sequence will be (assuming A1):
A1
AON
HG runs code
A1
AOFF
If you run some calculations, a sequence of 4 commands will take a minimum of 1.67 seconds.
If you are using the updated XTenLib file:
A1
AON
HG runs code
AOFF
This version uses 1 less command, so it would take a minimum of 1.25 seconds.
This test is VERY basic as far as HG goes, so I would anticipate each system taking very close to this minimum time. If so, I'll construct a more rigorous test to see if more complex code takes more/less time on different systems. Thanks for considering running this test!