필터 지우기
필터 지우기

Tic toc vs profiler for Arduino

조회 수: 4 (최근 30일)
Martijn Kortenhoeven
Martijn Kortenhoeven 2020년 5월 16일
댓글: Walter Roberson 2020년 5월 16일
Hello everyone,
I am trying to optimize a quadratic program solver for use in realtime on an Arduino for a control process. I have programmed two solvers, let's call them Solver 1 and Solver 2. When I use tic toc, there is almost no difference in computation time, but when I use the profiler, Solver 2 is almost 20 times faster than Solver 1. I read somewhere that the profiler only uses a single thread, while tic toc tends more to real time performance.
My question is: would I notice this significant performance increase when using Solver 2 on an Arduino, or would performance be similar using Solver 1? I am not that familier with an Arduino, and am also unable to test code on an Arduino unfortunately, but I could imagine that an Arduino could only use a single thread. Any insight would be greatly appreciated.
Martijn
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 5월 16일
If reducing to one thread does not change much then probably they will be close on the arduino.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2020년 5월 16일
You can get an idea by changing the number of threads to 1
Profile is not a good estimation of real time, as profiling disables optimization by the execution engine.
  댓글 수: 1
Martijn Kortenhoeven
Martijn Kortenhoeven 2020년 5월 16일
Thanks for your response! Do you think that would give an accurate representation of using it on an Arduino. I just tried the function you suggested but it does not deliver a major difference compared to tic toc. I also tried the timeit function.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Arduino Hardware에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by