Re: [SQLObject] sqlobject test suite weirdness
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Robin M. <rob...@gm...> - 2005-10-11 17:21:53
|
On 10/11/05, Victor Ng <cra...@gm...> wrote: > Hi, > > I've branched and modified the SQLObject trunk to use the SQLite > memory tables by default, this seems to have cut down the runtime for > the testsuite on my laptop from 600 seconds down to 23 seconds. With that dramatic an improvement, it seems likely that you're running into the OS X F_FULLFSYNC issue. SQLite 3 defaults to "PRAGMA synchronous=3DFULL" (see http://sqlite.org/pragma.html for details), which on OS X means it calls the F_FULLFSYNC ioctl. That does a *complete* flush all the way to the disk platters, including flushing the disk's own internal cache. Good for reliability, less good for speed. If you need speed more than you need reliability (say you're doing unit testing but your database can't just live in memory), then you may want to set "PRAGMA synchronous=3DNORMAL" before you start your testing. http://www.sqlite.org/changes.html says that F_FULLFSYNC is disabled if the synchronous pragma is anything other than "full". I'd be curious to know whether you see a dramatic increase in speed from doing "PRAGMA synchronous=3DNORMAL" on OS X before running the test suite. As for the rest of your email, I don't feel qualified to comment on it, except for the following: > I've noticed a bunch of locking in SQLObject. Specifically the use of > _SO_writeLock. Do we really need this? I'd like to see thread > safety pushed _out_ of SQLObject and make it the responsibility of the > caller. I almost never use threads, since they're so hard to get right. But I'd still like to see that locking stay, precisely *because* threads are so hard to get right. Making thread safety the responsibility of the caller is begging for thread-unsafe code, IMHO. What's your rationale for taking those out? Do you think it would produce better performance in the non-threaded case? -- Robin Munn Rob...@gm... GPG key 0xD6497014 |