i***w 发帖数: 9 | 1 After I profiled my programe, I found that the most time consuming part (
self time) in a function f(...) is something like this:
[A,B,C]= g(x,A,B,C);
I'm wondering why this statement will be slow? Since it's self time of f(...
),
it's not the time within function g(...). Does this mean the time is
consumed in copying matrix parameters A,B,C ? How can I improve the
speed? Thanks a lot. | s****y 发帖数: 2052 | 2 use C....
..
【在 i***w 的大作中提到】 : After I profiled my programe, I found that the most time consuming part ( : self time) in a function f(...) is something like this: : [A,B,C]= g(x,A,B,C); : I'm wondering why this statement will be slow? Since it's self time of f(... : ), : it's not the time within function g(...). Does this mean the time is : consumed in copying matrix parameters A,B,C ? How can I improve the : speed? Thanks a lot.
| s******r 发帖数: 350 | | n*****d 发帖数: 956 | 4 You may need to look inside the function. For example, if you have a number
of nested 'for', 'while' loops, it's bound to be slow. Change those into
matrix operations if you can.
Rewriting it in C is a good idea, if speed is an issue. I got a nonlinear
filter function running at least 20 times faster after rewritting it in C.
【在 s****y 的大作中提到】 : use C.... : : ..
|
|