Professional PHP

PHP Programming, Web Development, PHP Advocacy and PHP Best Practices.
« PHP Application Security
rsync to remote server via ssh »

Flawed Microbenchmarks

February 24th, 2005

Anatomy of a flawed microbenchmark highlights some of the problems involved in creating microbenchmarks (Java oriented).

The scary thing about microbenchmarks is that they always produce a number, even if that number is meaningless. They measure something, we’re just not sure what. Very often, they only measure the performance of the specific microbenchmark, and nothing more. But it is very easy to convince yourself that your benchmark measures the performance of a specific construct, and erroneously conclude something about the performance of that construct.

Even when you write an excellent benchmark, your results may be only valid on the system you ran it on. If you run your tests on a single-processor laptop system with a small amount of memory, you may not be able to conclude anything about the performance on a server system.

This is why I prefer to benchmark with ab rather than microtime().

Filed Under

  • PHP

Related Posts

  • Microbenchmarks of single and double qouting.
  • The Legality of Republishing RSS Feeds
  • The Usability of Input Filtering
You can leave a response, or trackback from your own site.

4 Responses to “Flawed Microbenchmarks”

  1. Lukas says:
    2/24/2005 at 3:00 pm

    Another good example is people measuring the performance overhead of parsing PEAR.php and then mentally multiplying this by the number of PEAR packages that use PEAR.php in their code. Obviously adding infrastructure code in userland is going to incurr overhead, however the point if such code is to make your general life easier. Therefore you are likely to make heavy use of said infrastructure code. This means that the parsing overhead will diminish. Obviously though you would want PEAR.php to have efficient code since its likely that code contained therein is going to be called often.

  2. admin says:
    2/25/2005 at 9:33 am

    Indeed. Good point.

    One might make the same point about breaking large code bases up into multiple small files. Bad for microbenchmarking, good for flexibility, reuse and modularity. :)

  3. Jeff Moore’s Blog » Blog Archive » Microbenchmarks of single and double qouting. says:
    3/8/2005 at 4:23 pm

    [...] Microbenchmarks of single and double qouting. I wrote earlier about flawed microbenchmarks. Today on sitepoint, there was a post on the perf [...]

  4. Lorette Raboin says:
    10/2/2011 at 8:50 am

    Hiya webmaster I like your publish ….

Leave a Reply

Click here to cancel reply.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

code: use [code=php][/code].

Comment Preview

    Subscribe Feed
    Share Subscribe to this blog…
    Share Bookmark or share this page…
  • About

    My name is Jeff Moore. I'm a PHP programmer living in San Francico and working for a startup.

    More about me…

  • Categories (Home)

    • Agile Methods (14)
    • Mac (14)
    • Misc (18)
    • Open Source (14)
    • PHP (99)
    • Software Design (29)
    • Usability (14)
    • Web Design (20)
  • Recent Comments

    • Why PHP is easier to learn than Java  50
      Jay Marry, Jutta Trudel, Betty Wager [...]
    • On the Perils of Inline API Documentation  16
      Glen Hollinger, Newton Boudoin, Chaussre Air Jordan [...]
    • un-Friendster: fired for blogging  5
      Un Hawse, Jim Skomo, Analisa Niccum [...]
    • PHP Book sales trends versus Java and Ruby  7
      Rosann Frederick, Glenn Leffingwell, byb bye blemish [...]
    • Let Your Properties be Properties  17
      Lupita Ziler, Lawrence Constanzo, nail dryer [...]
    • Upgraded to WordPress 1.2  3
      Laurence Morda, Ike Mcleish, Vilma Babers
    • PHP Coding Standards  12
      Twana Ventry, Luther Quelch, Rhett Ososki [...]
    • Commercial Zend versus Open Source PHP  11
      Loria Brendel, Billie Areola, Hans Stremmel [...]
    • A WordPress bug fix  7
      Malcolm Kinnon, Maximo Caoagdan, Kali Giesbrecht [...]
    • The PHP scalability saga continues  17
      Cameron Borah, Monty Gucciardo, Freddie Leaton [...]
  • Recent Posts

    • Richard Thomas
    • ZendCon: Writing Maintainable PHP Code
    • Looking Towards the Cloud
    • Holiday Tech Support
    • Closures are coming to PHP
    • php | tek Wrapup
    • php | tek 2008
    • Sarah Snow Stever
    • Benchmarking PHP’s Magic Methods
    • The Endpoints of the Scale of Stupidity on Video
  • Site

    • Archives
    • Log in
  • Search