Compiled MATLAB programs run slow.
Compiled MATLAB programs run slow.
(OP)
Hi all,
I've written a simple function to test the compiler:
function f = test()
tic
for i = 1:10000000
A = 2+5;
B = A/4;
end;
toc
The .m file run in about 0.1 seconds.
After I compile it(mcc -x test.m) the execution time increases to ~3 seconds.
I get the same effect if I compile it to a standalone.
-MATLAB version 6.5.1
-Compiler: Lcc C version 2.4 in C:\MATLAB6P5P1\sys\lcc
I did this after discovering that compiling a rather complex program I had written caused a slowdown.
Any ideas?
I've written a simple function to test the compiler:
function f = test()
tic
for i = 1:10000000
A = 2+5;
B = A/4;
end;
toc
The .m file run in about 0.1 seconds.
After I compile it(mcc -x test.m) the execution time increases to ~3 seconds.
I get the same effect if I compile it to a standalone.
-MATLAB version 6.5.1
-Compiler: Lcc C version 2.4 in C:\MATLAB6P5P1\sys\lcc
I did this after discovering that compiling a rather complex program I had written caused a slowdown.
Any ideas?





RE: Compiled MATLAB programs run slow.
Petr
RE: Compiled MATLAB programs run slow.
RE: Compiled MATLAB programs run slow.
CODE
tic
A = 2*ones(10000000,1) + 5*ones(10000000,1);
B = A./4;
toc
Matlab is not designed to work quickly with for loops.
M
--
Dr Michael F Platten