Skip to content
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

[Bug] To high cpu load #594

Open
alexzeit opened this issue Aug 15, 2024 · 1 comment
Open

[Bug] To high cpu load #594

alexzeit opened this issue Aug 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@alexzeit
Copy link

alexzeit commented Aug 15, 2024

Describe the bug

The performance of zenoh-pico in zephyr is not OK. It makes very high cpu load.
I have tested with one publisher and one subscriber in separate threads.

zenoh-pico publisher: dt 1ms payload 28 bytes
python publischer dt: 2ms payload 26 bytes

Here the Thread analyze:

0x24002288 zenoh-pico publisher thread
0x24003910 zenoh-pico subscriber thread

Thread analyze:
0x240021b0 : STACK: unused 1740 usage 1332 / 3072 (43 %); CPU: 0 %
: Total CPU cycles used: 3491514
0x24002288 : STACK: unused 2364 usage 1732 / 4096 (42 %); CPU: 24 %
: Total CPU cycles used: 10597211451
0x24003a20 : STACK: unused 1004 usage 1044 / 2048 (50 %); CPU: 0 %
: Total CPU cycles used: 2320557
0x24003910 : STACK: unused 336 usage 1712 / 2048 (83 %); CPU: 48 %
: Total CPU cycles used: 20912280179
thread_analyzer : STACK: unused 560 usage 464 / 1024 (45 %); CPU: 0 %
: Total CPU cycles used: 6940094
net_socket_service : STACK: unused 776 usage 440 / 1216 (36 %); CPU: 0 %
: Total CPU cycles used: 6666
rx_q[0] : STACK: unused 1088 usage 448 / 1536 (29 %); CPU: 5 %
: Total CPU cycles used: 2487365484
stm_eth : STACK: unused 1232 usage 304 / 1536 (19 %); CPU: 2 %
: Total CPU cycles used: 1169114540
net_mgmt : STACK: unused 272 usage 496 / 768 (64 %); CPU: 0 %
: Total CPU cycles used: 47966
tcp_work : STACK: unused 880 usage 144 / 1024 (14 %); CPU: 0 %
: Total CPU cycles used: 1344
shell_uart : STACK: unused 1448 usage 600 / 2048 (29 %); CPU: 0 %
: Total CPU cycles used: 62139925
sysworkq : STACK: unused 324 usage 700 / 1024 (68 %); CPU: 0 %
: Total CPU cycles used: 3957396
logging : STACK: unused 492 usage 276 / 768 (35 %); CPU: 0 %
: Total CPU cycles used: 1483785
idle : STACK: unused 272 usage 48 / 320 (15 %); CPU: 18 %
: Total CPU cycles used: 8155587915
main : STACK: unused 444 usage 1604 / 2048 (78 %); CPU: 0 %
: Total CPU cycles used: 6389063
ISR0 : STACK: unused 1840 usage 208 / 2048 (10 %)

To reproduce

  1. configure zenoh-pico peer mode and publisher interval=1ms
  2. activate zephyr thread analyze:
    CONFIG_THREAD_ANALYZER=y
    CONFIG_THREAD_ANALYZER_AUTO=y
    CONFIG_THREAD_ANALYZER_USE_PRINTK=y
    CONFIG_THREAD_ANALYZER_AUTO_INTERVAL=20
    CONFIG_LOG_BUFFER_SIZE=4096
  3. flash and start zenoh-pico publisher and subscriber
  4. configure python publisher and subscriber peer mode and interval=2ms
  5. start python publisher and subscriber

System info

  • zenoh-pico v 1.0.0.6 is running on Nucleo 144 H753ZI (Cortex-M7 480MHz)
    zephyr v3.7.0.0 SDK v0.16.8
  • zenoh python v 1.0.0.6 is running on ubuntu 22.04 on NXP RDB3 Eval board
@alexzeit alexzeit added the bug Something isn't working label Aug 15, 2024
@jean-roland
Copy link
Contributor

Hello @alexzeit, we intend to measure and improve performance and memory usage of zenoh-pico after the release 1.0 so we'll look into that in the near future but not now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants