Alex Cheng wrote:
Hi,
I want to know how many time is spent when create a sqlite connection.
> Is it effeciency? My application creates a connection and close it
> when access DB everytime, is it OK?
Going by your sig, here are the times for Python 2.5 running under XP
SP2 on a 1.6GHZ dual Athlon.
import timeit
t=timeit.Timer("C=sqlite3.Connection(':memory:')", "import sqlite3")
print "%d us per connection" % (t.timeit(10000) * 1000000/10000)
90 us per connection
t=timeit.Timer("C=sqlite3.Connection('diskfile')", "import sqlite3")
print "%d us per connection" % (t.timeit(10000) * 1000000/10000)
265 us per connection
The C times will be faster, but not by much.
Martin
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------