PDA

View Full Version : Performant code structuring & practices



ncanton
18 Nov 2010, 1:06 PM
I'm finishing up my first attempt at a Sencha Touch based app & I'd like to take another pass at my code with a focus on improving startup performance, which right now is taking about 15-20s on an iPod Touch for about 1500-2000 lines of code. It doesn't really seem that there's been much direction provided on which Sencha specific practices are going to help but I'm thinking one major area is that I may not really be taking advantage of lazy instantiation. I'm not sure how to do that though.

In some examples I see Ext.namespace or Ext.ns being used to prevent classes from being global - will that help? Is the initComponent function, which I can't really find info on, what we should use for lazy instantiation?

Is the twitter example the one to follow? I like the idea of moving to something MVC based but that's going to be a major rework I believe & for now I'd be happy just improving performance so are there any gems to extract from it?

If anyone is willing to take a look at my code then that would of course be awesome.

I'd also be happy to write up & share anything that I learn from my experience here but any help getting started is much appreciated.