Op 2-jun-2011, om 23:17 heeft Simon Slavin het volgende geschreven:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> On 2 Jun 2011, at 7:24pm, Roger Binns wrote:
>
>> (Incidentally I am the author of a "competing" Python SQLite  
>> binding and
>> hence know exactly which SQLite API calls result from bits of  
>> Python hence
>> being very pedantic about getting these tests the same.)
>
> How does your own Python binding perform ?  Is it fast like the  
> other Python binding, or slow like the GCC-compiled C code the OP  
> reported ?  Do you understand the strange result the OP reported ?
>
> Simon.

If I may answer the first question: APSW is even 31.7 % faster than  
the default Python wrapper, using the version below. It is however  
relevant to drop the table before each new test run. (I changed  
'create if not exists' to 'drop if exists' in both tests).

import apsw
import timeit
conn = apsw.Connection('test1.sqlite')
c=conn.cursor()
c.execute('''DROP TABLE IF EXISTS values_log; CREATE TABLE values_log 
(acquisition
INTEGER,chunk INTEGER, acq_data BLOB);
              CREATE INDEX IF NOT EXISTS values_step ON
values_log(acquisition,chunk);
           ''' )

def f():
   data="01234567"*1024
   with conn:
     for i in range(0,10000):
       conn.cursor ().execute("INSERT INTO values_log VALUES (?,?,?)", 
(1,i,data))
       if not i%10000: print i
ret=timeit.timeit(f,'gc.enable()',number=1)
print ret


_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to