0

Speed is King

Posted by Erik Gaius,aka [ K i r E ] on Monday, March 9, 2009, 1:09 PM in
A 1~2 second speed delay is huge, especially if your app is a web service. Kailangan ang isang web application ay almost instant ang loading. Dapat streamlined ang architecture - less queries, more data per cycle.

Isa to sa mga pagkakamali ng developers today. Inuuna ang development before optimization. In my opinion, dpat sabay un nangyayari. Just look at google - overly simple design, super fast engine. Kahit tumingin ka sa competitors ng google, like yahoo or msn, makikita mo na kahit gano karami ang content, mabilis parin mag load ang page (considering na dynamic ung page). 

So, teh tipz 4 teh day is this: Speed is King. Design apps with speed as one of the priorities. Optimize early - wag mung hintayin matapos ang app bago mag optimize. Instant load times is one of the keys. Hanapin mo kung saan tumitigil ang application mo, at gawan mo ng paraan para mapabilis un.

A few solutions:
1.) Cache - Kung palagi mong ginagamit ang isang piece of data, ilagay mo sha sa memory- wag sa database. Example: Kung bawat form ay kailangan ng data XYZ, gumawa ka ng variable na maghahandle ng data na un. Wag kang magquery sa database every time you need the data. 
2.) Avoid JOINs - Try to place all data in a single table. Avoid using views unless absolutely necessary. Kung nasa dalawang table ang data mo, halos mag ta-times two ang load time. 
3.) Lazy Evaluation - Delay a computation until the result of the computation is needed. Kung hindi pa kailangan, wag muna gawin.

Disclaimer: Stop at the business layer. Doing low level optimizations are best left to trained professionals ^^ ahahaha I mean, If you're using a low level language (Java, C++), may mga optimizations na medyo overkill kung early on plang gagawin na, such as bytecode editing.

That's it for now, at malaking pasensya po dahil medyo naging busy ako last week. Medyo maluwag na ko this week, so I'll be regularly blogging again. ^^ See ya next post!

0 Comments

Post a Comment

Copyright © Gains & Hart Co. 2009 .Net.ph All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.