Access time and performance

조회 수: 3 (최근 30일)
Franck AUBINEAU
Franck AUBINEAU 2023년 4월 25일
댓글: James Britton 2023년 5월 17일
You can see the code below and my problem about execution time. In my mind, there is no difference between line 8 and 22.
LFKEtat is a very simple handle class.
And I don't understand the difference between line 15 and lines 8 & 22. The access time is very long ?
My need is a cell array of "LFKEtat" and I didn't find a solution to optimize execution time.
If anyone has got an idea ?? Thanks

채택된 답변

James Britton
James Britton 2023년 5월 3일
Thank you for reaching out with your question. We are aware of the performance concern you have identified here and are working to make incremental performance improvements in the coming releases. That being said, allow me to explain the performance differences you are encountering.
Line 8 involves overwriting a variable that stores a reference to a handle object, with another handle. These handles use reference counting that must be managed whereas line 22 is only working on a scalar numeric value that is not reference counted and can be optimized using generated machine code that is very fast. Line 15 differs from line 8 in extracting an array from a container object which has extra overhead.
  댓글 수: 2
Franck AUBINEAU
Franck AUBINEAU 2023년 5월 3일
Thanks for the answer. Is there a way to optimize line 15 by using something different from a cell array adapted to handle object ?
James Britton
James Britton 2023년 5월 17일
Unfortunately no. Not at this time.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by