devel.reinikainen.net
HomeDocumentsCodeBugtrackerSearchreinikainen.netJB Consulting

PHP/MySQL SELECT Benchmarking

Jani Reinikainen, Address

21. March 2003

Introduction

Testing environment: Intel Pentium III (Katmai) 600MHz@672MHz, 256mb SDRAM, 80gb Western Digital 5400rpm IDE hard drive, Debian GNU/Linux 3.0r1 aka. Woody/Stable, PHP 4.1.2, MySQL 3.23.49, Apache 1.3.26.

The test was run with actual snippets of applications currently in use by undisclosured communities. The test scripts used to use a simple database abstraction layer for PHP, which was written by me. In these new verions, I have changed over to PEAR's database abstraction layer, as maintaining my own was too much work (and a bit like re-inventing the wheel). The benchmark itself is a part of PEAR. Incase you're wondering about the LATS.php, it's just a collection of text and string related functons, written by me.

Benchmarking

Conclusion

Method one is clearly faster (not to mention memory usage), even on small databases like my testing environment. With larger databases, the difference in speed is even more noticeable, in favour to method one.

References

Copyright © 2007 Jani Reinikainen. All rights reserved.
Permission granted to replicate information found on these pages, provided that all copyright headers/footers remain intact.