caliplus online | duramale online Yes, you should buy cytotec online at the best online pharmacy store where buy prozac hoodia online | neosizexl online | vigaplus online

Disclaimer / Motivation

First of all, it is important to note that this isn’t supposed to be a benchmark. The results of this test are worth what they are, it only means that PHP performed better than perl for this particular program.

For my thesis, I need to analyse large sets of data. The data is stored in the DataSeries format, which is a format developed by HP Labs specially for these type of things. I need to do several things with the data, so I created a script to do some basic analysis.

I had several options: I could write a shell script, or choose php or perl or something else instead. I realized that writing a shell script for this would be very complex, so I pondered between PHP and Perl. My feeling is that PHP is more suitable for Web and Perl is more suitable for sysadmin tasks, parsing, etc. I should choose Perl then, but my knowledge of Perl is very very basic, so I would need to learn it first. Unfortunately I am running against time, so I ended up choosing PHP since it would be very easy for me to write the script.

The test

So I wrote a first version of the PHP script. The script is not optimized whatsoever, but works as expected. The problem with a large dataset is that its parsing takes ages, and my first run took ages. I started wondering if a Perl equivalent would be a lot faster than the script I wrote, so I asked a friend to write an equivalent script in Perl. He wrote it and I ran both scripts at the same time on the same server. My friend noticed later that he had left an extra instruction in the main loop that doesn’t exist in the PHP version. Anyway, both scripts were already running so I didn’t abort the run. The results were quite surprising. The PHP version took 551m56.349s and the Perl equivalente took 712m16.792s.

Tags:, , , , ,

Although I’ve always agreed on the MVC pattern, specially the separation between the business and the presentation logics, I have to confess that throughout the years, my opinion about using template engines has changed a few times.

Back in 2003, I converted some of the IMP pages to templates and contributed some code to the Horde Templates engine. Back then, I presented some arguments in favor of template engines and one of the main reasons was the ability to send the templates to designers and have them doing what they want with them.

My experience quickly proved that I was wrong. Besides the fact that I added a bunch of lines to the code to define the template variables, the designers still needed a lot of help to customize the templates. Also, the code was slower until a template compiler was developed. Overall, the benefit from all that was null.

Since then, I think template engines are useless for most of the cases. I still agree you should separate business and presentation logics, but you can do it with PHP, you don’t need a different language for that.

Hasin Hayder, the author of a Smarty book, has an interesting post from earlier this year where he says that there’s no need of Smarty anymore:

I just dont need a wrapper over my PHP code which parse regular variable and echo them. Smarty just made itself extremely complex and useless too over the day, seriously.
I seriously don’t think there is need of Smarty anymore. Its dead!

There’s also a lot of buzz around the subject. You can also check the posts from Paul M Jones, and Michael Kimsal.

Tags:, , , , ,

O PHP Summer School já acaba amanhã. Cerca de vinta pessoas participaram neste curso e o resultado parece ter sido bastante positivo para os formandos.

Foi falado de tudo, desde Linux, Web Servers, o mais básico de PHP até tópicos mais avançados tais como OOP, Webservices, PHP&Performance e PHP&Segurança.

Esperemos agora que todos consigam tirar a certificação de PHP e se juntem ao clube. :-)
Eu como formador também gostei bastante da experiência. Aqui ficam os slides dos dois módulos que dei:

Tags:, , ,

Bruno and I took the Zend Certification exam here at the conference and I’m glad to announce that we both passed and we’re both ZCE now… :)

Here’s my certification authentication.

The exam had some tricky questions and it covers pretty much all of the aspects of PHP but I can’t say it was difficult.

For the ones who want to take this certification I really advise them to read the book: “The Zend PHP Certification Practice Book” written by John Coggeshall and Marco Tabini. You can buy it here.

Tags:, , ,

PHP and Unicode
Andi Gutmans from Zend, Andrei Zmievski from Yahoo!

- Definitions
. Character Encoding Form: representation of a character set using a number of integer codes (code values)

- Multi-i18n-what?
. Dealing with multiple encodings is a pain
. Different algorithms, conversion, detection, validation, processing… understanding
. Dealing with multiple languages is a pain too
. But cannot be avoided in this day and age

Tags:, ,