-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance Problems When Receiving Streaming Data #40
Comments
UpdateThe same problem also occurs with the SocketCAN interface on Linux. The only difference seems to be that the SocketCAN backend drops CAN packets without raising an exception. That is also the reason why I thought everything was working fine. Lessons LearnedAlways check the measurement data for lost packages. |
Performance MeasurementMeasuring performance on one of the efficiency cores of the M1 MacBook with: taskpolicy -b fish -c 'icon measure -t 10 -n Test-STH' showed about 30% performance usage without any code in |
Ideas to Improve PerformanceWe are already working on ideas to improve the performance in the branch Other ideas:
Note: It might make sense to count the number of instructions for a certain number of messages |
In theory the latest changes (currently in the branch 🌱; planned for release 2.0) should impove the performance slightly. Another big advantage of the new code is that it raises an exception, if the buffer for streaming data exceeds a certain fixed size (currently 10 000 elements). |
With the addition of a performance test to the extended manual tests I will close this issue for now. |
Description
It seems that the “new”
Network
class (based onpython-can
) might have some performance issues, if we use the PCAN interface (standard interface for PEAK CAN adapter on macOS and Windows) to stream data to the computer. After some amount of time the code throws aPcanCanOperationError
declaring that the “receive queue was read too late”.The same code works fine using the SocketCAN interface on Linux.Steps to Reproduce
Install ICOc in development mode
Check out commit 4b260bce for test script
new.py
Execute the following command in the repository
Expected Result
The script finishes without any problems.
Actual Result
After a certain amount of time the script prints the an error message that looks like this:
Additional Information
I tested the script three times on all of the (more or less) supported operating systems. One reason behind the failure (on macOS and Windows) might be the additional code (on top of python-can) in this repository. However replacing it with something like
pass
did not solve the problem (on macOS) when I tried. The CPU utilization stayed pretty much the same as far as I can tell.Regarding the CPU usage: Please take the values below with a grain of salt. I “measured” the CPU utilization using the graphical system monitor software provided by the different operating systems. This process is obviously not very accurate, especially since modern systems contain multiple CPU cores. In the case of the M1 machine below, these cores even have very different performance characteristics.
Linux
System
[email protected]
(2013)Test Results
CPU Usage: ~ 80% CPU (of single core)
macOS
System
M1 [email protected]/3.2GHz
(2021)CPU Usage: ~ 60% – 65% (of single core)
Windows
System
[email protected]
(2015)Test Results
CPU Usage: ~ 60% – 80% (of single core)
The text was updated successfully, but these errors were encountered: