Tuesday, December 19, 2006

 
PHP & it's Performance:

Factors deciding PHP's performance:

1. Algorithm

2. Performance characteristics

3. Application sub-system tuning like, OS, caching sub-system, databases etc.



PHP though has been designed keeping in mind "ease-of-use over performance" it does not mean that PHP is slow. Almost all functionality of PHP is written as high-speed C extensions. The fastest PHP code tries to make use of extension functionality as much as possible. Also, due to PHP's dynamic nature, PHP scripts are recompiled every time they are invoked. The most important optimization we can perform is to avoid this recompilation by installing an opcode cache such as Zend Accelerator or Turck. MMCache.

Monday, December 18, 2006

 
Ways to make your PHP Perform better:

1. Make sure that you do not include too many files.
2. Do use optimised queries and follow better RDBMS practices.
3. Do not use unneccessary variables.
4. Avoid code repetition.
5. Use REgEx only when required and not for every string operations.
6. Use some compression techniques when required to transport too many data, particularly through socket.
7. Profile your codes regularly.
8. Use benchmarking to find the problem areas before release.
9. Use caching techniques like APC etc.
10.Avoid using recursion, below 5th level.

 
Importance of Project Planning:

Project Planning is very critical for any successful project. Starting a project without project planning is like traveling in a car without a driver. For any successful project accomplishment, a proper plan must be put in place, before we start our interesting part -Coding..

Important phase of project cycle are as follows:

Planning: This is the phase where we start to think, how our application should work.We define different components and sub-components etc. This is the phase where we design classes and decide about the object interactions.


Coding: This is the phase where we start to write codes to make our planning a reality. We must should code per the coding guidelines and project planning.


Testing: Now testing can be further broken into:
a) Component Testing: When in a project we have many components involved we start component level testing, just to make sure that the components' requirement is meet.

b) System Testing: This testing is possible when all the components are ready and components can talk to each other. Here we test the whole system as a whole.

Of course we can go deeper and deeper in Development Life Cycle. And more we follow better it is. But at least we should follow the phases we discussed.

Will be back with some more information next time.

Saturday, December 16, 2006

 
This article is for the new PHP programmers who believes in "better coding practice"

Always before setting up a project, team should release "Project Structure Guidelines".

This guidelines are a way of defining the structure and appearance of the code that team is going to write for a given project. The guide line should focus on the areas like:

1. Describing the method and the style to be followed.

2. Class Definition Conventions to be followed.

3. Variable naming conventions to be followed.

4. Constant naming conventions to be followed.

5. Directory/Folder structure to be followed including the naming conventions.

6. Commenting Styles to be followed

7. Header and Footer structure to be followed.

8. Variable scope and globalization.

9. Documentation Structure.

and so on.
This guideline should act as a formal document and should be referred by each team member during the project.

I hope this guide line will be helpful.

This page is powered by Blogger. Isn't yours?