in reply to Trouble with Benchmark

Holy cow! You're right. I stuck in a long loop such as yours and suddenly there are a few tenths of a second showing.

I'm astounded because the code I was running was a query of a mysql database with over 12-million rows, pulling out 4,000 rows. In theory, that means the query took less than the 1/100 of a second mimimum displayable? Impressive.

Anyway, thanks.

Replies are listed 'Best First'.
Re^2: Trouble with Benchmark
by Anonymous Monk on Oct 06, 2004 at 12:12 UTC
    4,000 rows isn't much for most databases. If you've run the query before, it's likely the database still has the needed pages in cache - it might even have the query, its plan, and the result in cache. And if your database is running on the same machine as the benchmark, results are expected to be fast. Drop your indices, shutdown your database, restart the database, and run your program again. That might give you something to measure.
      Well of course nothing's as simple as it should be.

      OK - what's this? Shut down the database? I don't recall starting it up. I connected to it - is that what you mean? But I disconnect each time the script terminates.

      The benchmark on the same machine as the database? You mean the module?

      Drop my indices? The whole point is to measure performance with an index if that's how it's going to run, no?