Xi Status Update
I did some performance tests today using production code that will be available on Github in the next week or two. I am very pleased with the test results!
One of the design goals of Xi is to minimize network traffic between the Scratch Xi4s Client and the Xi Servers while minimizing CPU utilization as well. By using WebSockets in conjunction with the Johnny-Five library (@Rick Waldron - this library rocks!) the goal was accomplished. For sensors, network traffic is only generated when a sensor object detects a value update. An update message is then sent by the server to the XI4S client over the network.
When Scratch needs to retrieve the latest sensor data as the result of executing a "reporter" block, it does so by retrieving the data from the Xi4S local cache. This helps to minimize both network and CPU utilization.
Here is the Scratch script I used to run the test:
An Arduino Leonardo and BeagleBone black are configured each with separate potentiometers. Both Pots are then manipulated simultaneously while the Scratch script is running.
After some initialization, the Reporter blocks execute in a Forever loop.
To see the effects on network and CPU utilization, I attached a system monitor to the Scratch PC.
Here are the results:
The bump in network traffic, between the 40 and 50 second marks, is a direct result of manipulating both pots at the same time. XiDuino and XiBone detected the changes and sent data updates to Xi4S over the network.
While the messages are being sent, the forever loop continues to run and the "reporter" blocks retrieve the latest data changes in "real-time". If you notice, CPU utilization barely increases during the time period of the network bump.
This is exactly what the design called for and what it delivers!