> -----Original Message----- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of David de Regt > Sent: vrijdag 30 november 2012 18:41 > To: General Discussion of SQLite Database > Subject: [sqlite] Windows (slow) vs. iOS/OSX (fast) Performance > > Hey all. I've been struggling with a basic perf issue running the same code on > Windows vs. iOS and OSX. > > Basic query set: > CREATE TABLE test (col1 int, col2 text); > [loop 500 times]: INSERT INTO TEST (col1,col2) VALUES (4,'test4') > > I'm coding this using the default C amalgamation release and using > prepare/etc. on all platforms in the exact same way (same very simple DB- > access class I made). I realize that using a transaction around this would > vastly improve perf, but given the atomic nature of the app that this test is > simulating, it won't work to wrap it into transactions, so my goal is to improve > the atomic performance. These are all being run on the same Macbook Pro, > with an SSD, running Windows via boot camp, OSX natively, and iOS via the > iOS simulator: > > With defaults (pragma sync = on, default journal_mode): > Windows: 2500ms > iOS: 300ms > OSX: 280ms
On Windows Sqlite by default uses the real/full fsyncs to the hardware as provided by the OS, while on at least OS/X, by default it doesn't. See http://sqlite.org/pragma.html#pragma_fullfsync (I don't know about iOS, but I wouldn't be surprised if it doesn't have the same level of syncs) But that doesn't answer why the performance is so different when the syncs are off in your followup question. > > With pragma sync = off, journal_mode = memory: > Windows: 62ms > iOS: 25ms > OSX: 25ms > > Turning off sync doesn't make me feel warm and fuzzy about our lost-power > scenario, so with sync on, it seems like something must be fishy for it to be Bert _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users