PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

Stoimen Popov's Blog: PHP Performance: Bitwise Division

Note: This article was originally published at PHPDeveloper on 7 January 2012.
PHPDeveloper

Stoimen Popov has a new post to his blog today comparing the performance of bitwise division versus the normal "/" division operator.

Recently I wrote about binary search and then I said that in some languages, like PHP, bitwise division by two is not faster than the typical "/" operator. However I decided to make some experiments and here are the results.

According to his results using the bitwise method is slightly faster, but you'd only really notice it when working with large sets of data (like his example using 10,000,000). The code to run his benchmarks is included in the post.