Affichage des articles dont le libellé est iPhone. Afficher tous les articles
Affichage des articles dont le libellé est iPhone. Afficher tous les articles

dimanche 31 août 2008

iPhone apps performances


While struggling to speed up the app I am developping for the iPhone, I discovered how heavy and resources demanding the NSLog() method was. Ok, right, I know this is quite obvious, but if you forget to remove the NSLogs from your code, you will just see the responsiveness of the app drop by almost 80%. How lovely is it?
What is a pitty, is that I couldn't find any common or standard way of deactivating the NSLog() when building for Release. I had to use the infamous #define DEBUG 0 if(DEBUG) NSLog(...), like I was and its respectiveback in the nineties...

Hope this post will remind that you have to deal with this output !

C++ matrices and vectors library


The iPhone SDK is nice even if the iPhone developer program is crap (I will talk about that another time).

My main problem with it has been the external libraries I usually use, such as GSL (Gnu Scientific Library). Indeed, the software linked to it would perfectly work within the simulator but could not be used on the iPhone as the library is not compiled for ARM architecture. And I had no clue how to compile it for this platform.
I ended up looking for a simple algebra library (I just needed a few matrices and vectors manipulations), although I can't understand Apple not providing it... I also wanted to access elements easily , meaning I wanted a C++ library with operator overloading and not an Obj-C one.

I finally found the following library : C++ Grid from Kenneth Wilder
It is really straightforward to use. You just add the header which contains all the source in your project and that's it. The "gt_*" files are examples and they are very self-explaining and complete. Thanks Mr. Wilder for this lib !

However, I didn't test this library extensively and I guess the performances are not incredibely good, but it is certainly enough for simple things.