Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
performance issues in new and old style OO programming

Subject: performance issues in new and old style OO programming

From: Shaun Forth

Date: 8 Jan, 2010 16:59:05

Message: 1 of 1

I have coded a numerically intensive, operator overloaded class using both the old style and new style approach to OO programming:
  old style - all object functions in different files contained in folder @classname with constructor classname.m
  new style - all object functions in one file with separate properties and methods sections.
My preliminary findings are that the new style runs twice as slow as the old (under R2009b) for small problem sizes - with convergence of the performance as I increase the problem size, and hence number of flops performed, while keeping the number of overloaded operations fixed.

I was disappointed by this performance - I hoped that since the parsing and some JIT analysis might be performed on the single classname.m file of the new style it would be more efficient, and definitely no worse, than the old style.

Have others had similar experiences and perhaps improved things?
Does anyone have an explanation as to why this happens?

I like the new OO style but can't afford to compromise efficiency to this degree!!

Shaun

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us