Tutorials

Speed up MATLAB on MacOS X

On MacOS X 10.5 there is considerable slow-down in the MATLAB editor and other GUI elements. The issue is related to a change in the default Mac Java 2D rendering engine from Quartz2D (10.4) and Sun2D (10.5). This newer rendering engine improves performance for figure drawing, but other GUI operations are slower.

The temporary fix is to instruct MATLAB to use the old rendering engine (Quartz2D). This will speed up scrolling and most GUI operations, at the cost of reduced figure drawing speed.

method/1539/Screen Shot 2013-03-24 at 12.20.16.png

Open a terminal and browse to to your Matlab app bundle, eg.

python
cd /Applications/MATLAB_R2011a_Student.app

Your MATLAB folder will likely be different to this. A quick way to find it is to use the tab key. At the command-line enter cd /Applications/MATLAB then hit <tab> and the name should autocomplete.

If you're on 2008a or later, you need to browse down to the maci folder.

python
cd bin/maci

or for 64 bit

python
cd bin/maci64

Again, typing cd bin/maci<tab> should get you there.

At the command line type nano java.opts to create a new empty file and open a command-line text editor. You can copy and paste into this window, so simply copy the text below and paste it onto a new line in the file.

python
-Dapple.awt.graphics.UseQuartz=true

To save hit Ctrl-X(exit) then press Y to save and Return to accept the filename

You can also optionally add -Dapple.laf.useScreenMenuBar=false to turn off the Mac top-of-screen menu bar. This appears to also slightly increase speed.

Restart MATLAB and you should see a speed improvement.

As this fix may reduce drawing speed of figures, you may want to switch off the workaround while doing a lot of figure drawing. You can do so by exiting MATLAB, renaming the java.opts file e.g. to java.opts.off with mv java.opts java.opts.off and restarting MATLAB. To re-enable simply quit, rename the file back to java.opts with mv java.opts.off java.opts and restart.

PyQt/PySide 1:1 Coaching with Martin Fitzpatrick

Save yourself time and frustration. Get one on one help with your Python GUI projects. Working together with you I'll identify issues and suggest fixes, from bugs and usability to architecture and maintainability.

Book Now 60 mins ($195)

Elsewhere

Find all files containing a given string
Piping between shells
Install HomeBrew package manager for Mac
Creating GUIs with PyQt - Lecture 11: Mozzarella Ashbadger - Building a web browser in PyQt