I need an established reference on optimizing Matlab code.

조회 수: 1 (최근 30일)
Evans Harrigan
Evans Harrigan 2020년 8월 6일
댓글: Cris LaPierre 2020년 8월 7일
I'm working on a project that uses Matlab for functional prototyping of producton applications. The initial phase is developing Matlab code to verify algorithms. The 2nd phase is using the verified code for limited production stress testing. Moderate performance objectives must also be met. Phase 3 involves an expanded # of key applications to be extensively production stress tested. In Phase 4 all applications that satisfy Phase 3 testing are released for production. In Phase 5 performance is the critical key performance metric (KPM) for success. Hence, continuous code optimization is done.
Can you recommend documents on optimizing Matlab code? Text books, whitepapers and, ideally, Mathworks documents are of interest.

채택된 답변

Cris LaPierre
Cris LaPierre 2020년 8월 6일
Not sure if this is what you are looking for, but here are some resources I'm aware of:
  1. MATLAB Performance Optimization
  2. Performance and Memory
  3. Techniques to Improve Performance
  4. Optimizing and Accelerating your MATLAB Code
  댓글 수: 3
Evans Harrigan
Evans Harrigan 2020년 8월 6일
Chris,
Not surprising; we expect that all of the optimization options proposed will be used where appropriate. Our leadership will request that we assess the potential level of effort for implementing the various methods and estimate the benefits realized. Yes, this is asking about return on investment (ROI).
Regarding methods listed in Option 1, we're already using code profiling. Vector based processing is of personal interest, given my background as a former Cray Research, Inc. Applications Specialist. Do you have any historical data on % improvement achieved from using this method on appropriate MATLAB applications?
MATLAB Code Generation (MEX) is also attractive, and similar historical data regarding % improvement achieved is welcome. I haven't evaluated this method extensively, though I recall that the code generated is C. Please advise, if this is correct.
Thanks, again, for your assistance.
Evans C. Harrigan
RPI-CS, Inc.
Boeing Contractor
Cris LaPierre
Cris LaPierre 2020년 8월 7일
The gains from vectorization are highly dependent on the application (what the unvectorized solution is). There are scenarios where it is much faster, some where it is comparable, and some where it is slower. I think for these reasons, I'm not aware of a documented "expected percent improvement".
I'm less familiar with MEX, so I'd suggest Walter's reply in this post. In looking for that, I did discover other posts on the topic that may also be helpful.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by