My first “program” was a BASIC script on Commode 64. It was able to print some text on the screen twenty times. The text was “Hello world”. I copied it from a book which I hoped I can learn write games from ( I never really wrote any game except the one for a homework at university ). Since then the languages have been advanced…
I don’t want any religious argument about which language is better than the other. I wrote so many website in so many different php frameworks I stopped counting a long time ago. From the homemade “custom framework” to the heavy-weight symfony I saw the evolution. Although I’ve made a lot of administrative script in PERL and a bunch programs in Python I never wrote any website based on these languages in turn they should be as much good as PHP is (if not better). I’m familiar with Django. I wrote a monitoring system and Continuous Integration tools in Django. I remember the old days when CGI script was written in PERL. So I decided I test them. Which is better for what and why?
Principles
- The framework should be fast. Very fast! That’s the top priority
- The ORM has to be involved in the tests.
- The framework should not eat up all the resources on the host machine. This is essential.
- The framework should be easy to program.
- The learning curve. Rather interesting than important.
- The installation and maintenance.
I was looking for similar tests in google but I could’t find any comprehensive one. I don’t say this would be it but it covers all the aspects I wanted.
And I think I have to explain why the ORM has to be involved. I know and I agree that the overhead of a framework should be measured with a simple Hello world! example as a lot of tests did I saw on the internet. But I don’t care about the overhead of a framework compared to plain PHP/PERL/Python code. I really don’t. I decided to work in framework. I’m interested in the performance, system requirements, features and manageability of the different frameworks based on different languages.
Candidates
- Catalyst framework (PERL)
- Django (Python)
- Symfony 1.2 with Propel (PHP)
- Symfony 1.4 with Doctrine (PHP)
Why is there two different versions of symfony? Because up to this day both of them are used for very big sites. Symfony 1.4 with Doctrine is a little bit more sophisticated, have more features and have much more plugin to it. However Symfony 1.2 was shipped with Propel as default ORM which is still claimed to be significantly faster than Doctrine. So that’s the reason for it.
Environment
I’ve created virtual machines for all the framework one by one cloned from the same source. The operation system was a CentOS 6.2 minimal install. I installed the necessary packages like vim, make, gcc, nginx and Percona Server 5.5 etc. and then make a snapshot of the box. This snapshot was the basis of the VMs. The system parameters were:
- 600 MB Ram
- 1 core CPU
- 8GB HDD (50-70 MB / sec read)
- CentOS 6.2
- Percona MySQL Server 5.5
- Nginx 1.0.12
The Test
1. A started to install the frameworks from scratch just like the documentation describes it. I wanted to see how hard to get a working copy of the framework.
2. Run the framework in development mode and see the its default behavior.
3. Create the model from database. Note: I know this is a little bit different than the recommended way but the idea was that I have an application with a database under it and I want to change the application from my old “framework” to a professional one.
4. Create the standard view.
- The list of the elements limit by 10.
- The detailed view of one object/row whatever you call it.
5. Load it heavily with ab (apache-benchmark). See the required resources during the test and check the results.
Recent comments