perrin (email not shown publicly) Perrin is a contributor to various Perl-related projects like mod_perl, Template Toolkit, and Class::DBI. He is a frequent speaker at OSCON, YAPC, and ApacheCon, and a contributor to several perl-related books.
There's no reason to use explicit transactions for just one individual statement. Just turn it off. It's still transactionally safe - the DB just does the commit for you internally instead of having to cross back to the SQL compiler.
I did try it, but it had no significant effect on the performance numbers. The only thing that helps is leaving off transactions entirely, and that won't work for sharing the data between processes.
Also what is your test platform? Be careful of Mac OSX - the "commit" there uses a special mac fcntl which guarantees that data is on the platter even on IDE. BerkeleyDB and MySQL don't do that - they just do an fsync. You can disable this - email me if that's the platform you're testing on.
My recommendation is to test on Linux with SCSI disks where the fsync doesn't lie.
I'll take a look at the rest of your code now that you say you've tried my suggestion. But this may just be one area where SQLite isn't
I tested on Fedora Core 3 with a pretty standard consumer-grade IDE drive.
It may be a bad application for SQLite. I just wanted to check it out because I heard SQLite 3 had made some big speed gains. The use case that I'm ultimately looking at here is storage for cache data between mod_perl processes.
The speed gains in SQLite3 seem to be more related to multiple concurrent readers, rather than raw performance. Your code (at least for me) runs faster on DBD::SQLite2.
Memcached is a lot slower than Cache::FastMmap, BerkeleyDB, or even a local MySQL in this benchmark. It should scale better, and it works for a cluster while some of those others don't, but the raw performance it gives is about the same as SQLite. Anyway, my plan is to provide a cache module that can switch between these so that people can use what works best for their situation.
Do you find the concurrent access to be OK with BDB? I've had real problems with it in the past, and for some applications had to switch to SQLite just to get working (albeit slower) concurrency.
Turn on AutoCommit (Score:2)
Re:Turn on AutoCommit (Score:1)
Re:Turn on AutoCommit (Score:2)
Re:Turn on AutoCommit (Score:1)
Re:Turn on AutoCommit (Score:2)
My recommendation is to test on Linux with SCSI disks where the fsync doesn't lie.
I'll take a look at the rest of your code now that you say you've tried my suggestion. But this may just be one area where SQLite isn't
Re:Turn on AutoCommit (Score:1)
It may be a bad application for SQLite. I just wanted to check it out because I heard SQLite 3 had made some big speed gains. The use case that I'm ultimately looking at here is storage for cache data between mod_perl processes.
Re:Turn on AutoCommit (Score:2)
The speed gains in SQLite3 seem to be more related to multiple concurrent readers, rather than raw performance. Your code (at least for me) runs faster on DBD::SQLite2.
Re:Turn on AutoCommit (Score:1)
Re:Turn on AutoCommit (Score:2)
Re:Turn on AutoCommit (Score:1)