Optimizing Moquu for iPhone 3G
As you may already experienced, Moquu had several problems on iPhone 3G devices. So one of the most important task during update developments was to “repair” the 3G experience.
The first problem was around storing the frames during a capture session, some problem with the memory allocations (this stackoverflow post is about the same problem).
After that the main issue was to optimize the memory consumption. The common moquu size is 600x450 for now (this is the display size on every web surface).
As we implemented the effect processing in OpenGL ES, the texture buffer sizes has to be “power of two” textures (1024x1024, 1024x512, etc.). To store the frames in OpenGL textures with the size above, the planes has to be 1024x512, which method is wasting some memory. So I began to play around with different Moquu sizes to see which quality can make it.
This one is the original iPad/iPhone 4 quality (450x600).
Now this is the halved size (225x300), it fits into a 512x512 texture buffer easily, but we had to trade too many quality here.
So the final solution in somewhere in the middleground (this moquu has a base size of 360x480). Still fits into the 512x512 plane, and quality is still reasonable.
As the Moquu size is determined runtime in the App, the logic needed some refinements, and default Moquuments had to be resized on the fly as well, but in the end the 3G experience became far more stable than it was.
Another tiny issues during update development was to get the Application size below 20 MB (over this limit the App can be downloaded via WiFi only).
As it turned out (from a brief explaination at Steffen Itterheim’s post), there is a tricky way to estimate your “final” app size. The uncompressed .app file’s size (in the archived package), the zipped bundle (without the .app file), and an additional 100 Kb (some iTuens metadata). The .app file’s size may vary after submission down to Apple’s encryption, there is nothing to do with it.





![This is Luke Wroblewski’s opening session ‘Mobile First’ at the Mobilism 2011 conference in Amsterdam. Szajmon is there, too [obviously, we needed some time without him]. So you can follow our tweets @moquu or just looking for the #mobilism hashtag.](http://25.media.tumblr.com/tumblr_ll2sgfLYHQ1qjoxp3o1_r1_500.jpg)