0

So, here is my setup:

  • I have an application with a GUI written in Matlab (2011b 64 bits).
  • Relevant ? this application calls a dll written in c++ compiled by VC10 and nvcc (cuda compiler).
  • I configure Matlab to compile with VC10 when running "mbuild -setup".
  • I compile this application with the Matlab Compiler toolbox using default settings. The compilation line is:

    mcc -o ICEM -W main:ICEM -T link:exe -d C:\Users\Ernest\Documents\Matlab\icem\ICEM\src -w enable:specified_file_mismatch -w enable:repeated_file -w enable:switch_ignored -w enable:missing_lib_sentinel -w enable:demo_license -v C:\Users\Ernest\Documents\Matlab\icem\Main.m

The result is an application that works fine, but an order of magnitude slower than when I run it directly from Matlab.

To be clear, the problem is not the time my application takes to start. It takes much time to start because it has to load MCR, I am aware of it. The problem occurs during the execution of some display function that involve some calculation, all along the execution of my application, and I don't understand how/why it can be slower.

Do you have an idea where this could come from ?

Ernest_Galbrun
  • 2,514
  • 3
  • 21
  • 33
  • http://stackoverflow.com/questions/15967157/matlab-executable-too-slow/15967544#15967544 – Oleg May 07 '13 at 14:34
  • No, the problem is not at startup. Well, it is too, but I am aware of it. My problem occurs during the execution of the program. – Ernest_Galbrun May 07 '13 at 14:36
  • 1
    Could you try timing various parts of the code with `tic` and `toc`, and see where the large difference is between compiled and non-compiled? Furthermore, if it is not the startup, then file/directory access would be my next suspect. – Dennis Jaheruddin May 07 '13 at 15:54
  • Ok, so the problem was due to the fact that the gui was not refreshed as often when ran as a standalone. I added a drawnow an now it workd fine, but I still don't understand why the automatic refreshing would not occur at the same time in the compiled version, is it documented somewhere ? – Ernest_Galbrun May 09 '13 at 15:15

0 Answers0