Tag Archive for 'shootout'

PHP: speed of string replacement functions

What is the fastest string replacement function in PHP? sprintf() is probably the fastest, but it’s only useful in limited situations where the input is prepared for sprintf formatting. preg_replace() is obviously the slowest. The big debate is whether str_replace() or strtr() is faster.

The lixlpixel PHP benchmarks show that strtr is the faster of the two. I then came across Simple Machine’s benchmarks which show that str_replace() is faster. Hmm what’s going on?

Syridium DV’s PHP benchmarks performs more varied tests with these two functions. The relative speed of these two functions might vary depending on the type of string replacement you are performing. However, it seems that str_replace() is usually a safe bet.

If you liked this post, please subscribe to my feed. Thanks for visiting!

Finding an image gallery app is harder than I thought; Zenphoto is promising

Spent a few hours today looking around for an image gallery application. Gallery 2 cannot run in PHP Safe Mode. Plogger for some reason runs at snail’s pace on my server; I couldn’t even get into the admin panel. Coppermine looks so Web 1.0. Thank goodness I stumbled across Zenphoto. It’s actively developed, is fast and simple, looks nice, and actually installed without a single problem.

To-do: Figure out why I had problems running Plogger. Try Pixelpost.

Here’s a good but out-dated list of photo CMS’s on the market. Anyone have other suggestions?

Update: Plogger not working was entirely my fault. My .htaccess redirects requests for CSS/JS to a directory with pre-gzipped versions of the file. I did not pre-gzip Plogger’s CSS/JS files and did not turn off the .htaccess directive, so it appears that my browser was trying to access non-existent CSS/JS files. Strange that it resulted in super slow pages; I thought the browser would get a 404 response and give up immediately.

Still, Plogger doesn’t work well in Safe Mode, and I was not impressed enough to use workarounds to make it play nice.

Also tried PixelPost. It doesn’t even support importing images on the file system (ex. uploaded via FTP) very well; it relies on an addon to do that, and it failed for me. Not impressed with it enough to try to make it work.

So back to playing with Zenphoto.

PasswordMaker: safe, secure, simple, site-specific, smart password management

I ran out of adjectives starting with “S” to describe what I believe is the very best password management solution currently available, PasswordMaker. PasswordMaker is an implementation of the on-the-fly site-specific web password hashing system.

How many accounts/passwords do you have? One for your Email? Bank(s)? Credit card(s)? Phone companies? School? Work? Utilities? Google? Yahoo? Facebook? MySpace? Amazon? Ebay? NYTimes? Torrent trackers? That annoying website that made you register just to use the simplest feature? (Oh wait, every website is like that nowadays.) I think you get the point. Even the average, casual Internet user can easily have dozens of accounts/passwords. In this day and age, computerized password management systems are absolutely necessary for even casual Internet users, and PasswordMaker is the king of password management.
Continue reading ‘PasswordMaker: safe, secure, simple, site-specific, smart password management’