Hi Thomas, no, I can't reproduce it in C. The problem is not worth the effort, I can live with these timings, it's just strange.
I don't think it's an interface problem. I'm using Tcl, more or less the 'natural' language for sqlite. Tcl doesn't have a garbage collection. The strangest thing is, I can reproduce this behaviour. I'm absolutely clueless. I stumbled over it by coincidence. Tried 1000 repetitions, was quite fast, so I tried 10000, which was even faster. This led me to the (obviously wrong) conclusion, that sqlite spends some time parsing the sql. Next I tried 100 repetitions, expecting a bit more than 76 microseconds. 310 microsecs didn't bother me really, I tried the 10 reps expecting even more. Then came the surprise: only 67 microsecs. My first feeling was, something like a busy disk or so came in just when I tried the 100 reps. But the results were reproducible, deviating only by a few microseconds. The solution to this riddle is not really urgent, it's just totally confusing. I'm curious. Thanks and kind regards Ulrich On Wednesday 22 February 2006 00:08, Thomas Chust wrote: > On Tue, 21 Feb 2006, UlrichSchöbel wrote: > > [...] Where do those 309.95 microseconds come from? What's the > > difference between running a query 100 times or 10000 times? Should I > > avoid running a select exactly 100 times for some obscure reason? [...] > > Hello, > > can you reproduce similar timings in plain C? If not, I would guess that > the "problem" lies somewhere at the interface between C and the language > you are using. There can be lots of different reasons; a common one for > high level languages are garbage collection cycles, for example. > > cu, > Thomas Chust