Speed up Matlab on OSX 10.5 (contributed by Fred Nugen a.k.a. nooj)

Matlab is absurdly slow on mac 10.5.

There are three workarounds that i suggest:

  1. Use 10.4

  2. Run matlab from an X11 terminal directly:

    /Applications/MATLAB_R2007b/bin/matlab &
    
  3. Use the official MathWorks bugfix. (i had to put the java.opts file (attached) in the dir from which i execute matlab in solution 2.)

SOURCES:

Forum discussion suggesting both 2 and 3 (eventually):

http://www.mathworks.com/matlabcentral/newsreader/view_thread/144169#402487

Official mathworks bugfix:

http://www.mathworks.com/support/bugreports/details.html?rp=412219 (requires login, so it is pasted below)

Be sure to read the last paragraph

Summary Macintosh OS X 10.5: slow scrolling in MATLAB Editor and some other GUIs

Report ID 412219 Date Last Modified 06 Mar 2008 Current Product Name MATLAB Exists In Version 7.6, 7.5, 7.4 Exists In Release R2008a, R2007b, R2007a Fixed In Version OPEN Fixed In Release OPEN

Summary Macintosh OS X 10.5: slow scrolling in MATLAB Editor and some other GUIs

Description On Macintosh OS X 10.5 platforms, scrolling in the MATLAB Editor and some other GUIs is slower than it was on OS X 10.4.

This is due to a different default Java JVM Graphics2D rendering engine used by OS X 10.5 (Sun2D), where OS X 10.4 used Quartz2D. The new engine results in better performance for some graphics operations such as figure drawing, but slower performance for some other operations such as scrolling.

Workaround To improve the scrolling performance in the Editor and other tools, download and unzip the attached file, java.opts to the Applications > MATLAB folder for R2007b and earlier, or to the Applications > MATLAB > bin > maci folder for R2008a or later, or to the directory from which you launch MATLAB from an xterm or Terminal command line.

The java.opts file contains the text

-Dapple.awt.graphics.UseQuartz=true which instructs Java to use the Quartz version of Graphics2D when StartMATLAB is launched.

To confirm that the java.opts file is working, type the following in the MATLAB Command Window and ensure the result is true:

java.lang.System.getProperty(‘apple.awt.graphics.UseQuartz’)

Figure drawing might become slower as a result. You might want to stop using the workaround while doing extensive figure drawing. To do so, quit MATLAB and temporarily rename the java.opts file, for example to java.opts.off, then restart MATLAB. You can resume using the workaround by quitting MATLAB, renmaing the workaround file to java.opts, its correct name, and restarting MATLAB.