IV> I've spent a long time debugging low performance of an
IV> application that uses :memory: database and have found
IV> that sqlite v2 is much faster than v3. After some
IV> digging around it seems that even two proof-of-concept
IV> programs that are identical except for used SQLite
IV> version reproduce this behaviour just fine:

>> ./sqlite3_bench 
IV> 2564 qps
>> ./sqlite_bench
IV> 20000 qps

IV> (that's queries per second)

IV> I've attached the source of these two programs, but in
IV> case the attachments get stripped: all they do is open
IV> a database, create a simple table with 3 fields, set
IV> one of them as primary key and add a index on another
IV> field, then insert 100,000 dummy records.
IV> Approximately the same situation is for a test that
IV> selects 100,000 records from this database one by one,
IV> only sqlite3 is about 2x faster in this case (sqlite3:
IV> 6000 qps, sqlite2: 20000 qps).

IV> Is this a "known behaviour"? Should I stick to using
IV> sqlite2 for memory databases?

Two questions:

Does it only happen with a :memory: database or even if you use a
file?

With version of the v3 lib did you use?

I'm asking because i noticed a similar performance drop (factor 10-15)
when i wanted to upgrade my application from 3.2.1 to 3.3.5

Regards,
Eric

Reply via email to