Benchmark: dirname(__FILE__) vs __DIR__ in PHP

dirname(__FILE__) and __DIR__ give exactly the same result in PHP, although one (__DIR__) is evaluated at compile-time, while the other (dirname(__FILE__)) has at least part of it (the function) evaluated at execution time. Ever wondered what the difference is, in terms of efficiency, between the two? I've written a *very* simple script to try it out:
<?php
$loops = 100000000;
echo 'Testing dirname(__FILE__)' . PHP_EOL;
$start = time();
$dir = '';
for ($i = 0; $i < $loops; $i++) {
 $dir = dirname(__FILE__);
}
echo 'dirname(__FILE__) took ' . (time()-$start) . 's' .

mbstring vs iconv benchmarking

Following up on my previous post about the differences between the mbstring and iconv international characters libraries (which resulted in a tentative conclusion that nobody knew anything about those differences), and particularly the comments by Nicola, we have combined forces (mostly efforts from Nicola, actually) to provide you with a little benchmarking, if that can help you decide. Nicola wrote the following script (which he gladly releases as public domain license) to test th

HOWTO Speedup your Debian GNU/Linux

This article was first written in January 2005 for the BeezNest technical
website (http://glasnost.beeznest.org/articles/195).
Warning: This article is still work in progress. You have to keep in mind that speed is somewhat relative. It is often just a question of personal feeling, especially for a desktop machine. There are many ways to speed your Linux installation. Here, we will show how to do it on Debian Sarge+, but most tips should also improve performances on other distributions. We will focus on a desktop install.