## 4 Results
### Comparison of Serial, OTA, and Dynamic (VM) Software Updates  
In an analysis of firmware update performance for an ESP8266 system, testing was conducted on OTA (Over-the-Air) updates, serial updates, and dynamic configuration updates within a virtual machine (VM). The tests covered various firmware sizes, beginning at 75 KB and progressing up to approximately 1 MB. For the first two types, a basic \"Hello World\" firmware served as the foundation, with the file size increased by padding it with a byte array. In the VM-based updates, additional size was achieved by embedding dead code or no-operation instructions. The network speed was intentionally restricted to 1 MBps to simulate realistic conditions, while the serial interface was limited to a 9600 bps baud rate, reflecting a standard low-speed connection. The main metric used is the total update time, which spans from the initiation of the update request to the full firmware initialization, with system reset duration--which includes reloading essential modules--and reestablishing  
Figure 21: (**a**) Histogram for serialization times; (**b**) histogram for serialization request sizes (authors’ contribution). network connectivity also being taken into account, applicable only to the OTA and serial updates [29]. This measurement aims to provide a comprehensive overview of the firmware update process under typical constraints. The results, depicted in Figure 22, reveal a distinct disparity between the different update methods as firmware size increases. The serial interface, due to its limited baud rate, demonstrated the highest update times, which escalated considerably as the firmware size grew. For example, at a firmware size of approximately 900 KB, serial updates required nearly 120 s to complete, highlighting the severe limitations imposed by low baud rates in serial communication. This outcome is expected, as the serial communication speed inherently restricts data transfer rates, particularly when dealing with larger firmware files. OTA updates performed more efficiently than the serial updates, maintaining a more stable update time across the tested firmware sizes. However, OTA updates incurred additional delays due to network variability and reconnection delays. Each OTA update required a network reconnection and a soft reset after the transfer, adding an average delay of several seconds, likely due to the overhead involved in establishing and securing the Wi-Fi connection for each update cycle. Nonetheless, OTA updates demonstrated consistent performance, with fluctuations largely attributable to network factors rather than the update mechanism itself. The dynamic VM configuration updates, which relied on deserialization and dynamic code reloading within the VM environment, displayed a significantly shorter update time. The VM configuration changes consistently occurred in less than two seconds, regardless of the firmware size, demonstrating the efficiency of in-memory updates with minimum reliance on network or serial interfaces. In cases where the configuration reached a size of approximately 900 KB, the VM-based updates averaged around 1.17 s. Of this time, about 1 s was devoted to content transfer, 30 milliseconds to garbage collection, and the remaining time to deserialization and loading the \"FunctionObject\" into the VM. These results suggest that the bottleneck for VM updates lies primarily in network speed, particularly during the content transfer phase, while the deserialization and initialization steps incur minimal delay, operating in the order of milliseconds. The results presented in Figure 22 underscore the efficiency of VM-based dynamic configuration updates in scenarios where rapid reconfiguration is required. The near-constant update time for the VM configuration, regardless of firmware size, contrasts sharply with the linear increase observed in serial updates and the relatively stable, though slower, performance of OTA.