Why did Matlab performance massively decrease for basic arithmetic operations from Matlab R2014b to 2015 and 2017 version?
11 个评论
The problem with using a symbolic solution to a linear system is not so much that unnecessary terms are used: You risk losing a lot of precision in the intermediate steps of the calculation. So a formula that is mathematically accurate may well be numerically unsafe.
Have you tried solving the linear system directly in MATLAB? As John has said, I would expect that to be much faster (and more accurate) than evaluating the very long symbolic solution. To solve a linear system A*x=b, if matrix A and vector b are available as numeric (not symbolic) variables, call
x = A \ b;
If you have thousands of such systems, the best way is probably to just wrap a for-loop around this statement, but if A stays the same and only b changes, you can replace b1, b2, b3 with a matrix B = [b1 b2 b3], and solve all in one go using A \ B.
About the difference in performance from R2014 to R2015: In R2015b, the old just-in-time compiler (JIT) was replaced with the new execution engine. This has made many cases faster, but it's possible that the JIT was faster for your case.
"but it's possible that the JIT was faster for your case."
Interesting... Christine, is the implication that currently MATLAB uses something that is no longer called just-in-time compiler (JIT) ? If so then is the new term "executation engine" ?
"JIT" at least gave us a hint as to how the execution was being handled; is it no longer "just in time" compiling, or is it still "just in time" technology but a different name ?
Walter,
The new Execution engine is still a JIT. The official description describes it quite well. Internally we refer to the old engine as the JIT and the new system as the Execution Engine or by an internal acronym. Occasionally these naming systems leak out or cause confusion.
I will guess that in this case the code is being executed with an eval statement or as a script, not in a function, and that is a significant factor in the performance difference.
It is also possible that the performance difference is due to compilation time not execution time. What is the time difference on the second or 100th call to the code?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Numeric Solvers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!