I don?t test the returned values because it?s just a test case. And ?sqliteLog' function will tell me if it failed.
I compare the same thing in ?DELETE? mode just now. 1-thread result, 2015-11-02 10:53:21.179 TestSQLite[1647:586781] 0: 1446432801.075409, info: NSThread: 0x15de373a0{number = 2, name = (null)} start 1: 1446432801.179614, cost 0.104205, info: NSThread: 0x15de373a0{number = 2, name = (null)} end 4-threads result, 2015-11-02 10:52:26.908 TestSQLite[1644:586341] 0: 1446432746.741779, info: NSThread: 0x147d4c7b0{number = 5, name = (null)} start 1: 1446432746.908137, cost 0.166358, info: NSThread: 0x147d4c7b0{number = 5, name = (null)} end 2015-11-02 10:52:26.923 TestSQLite[1644:586346] 0: 1446432746.746527, info: NSThread: 0x147e05230{number = 4, name = (null)} start 1: 1446432746.923394, cost 0.176867, info: NSThread: 0x147e05230{number = 4, name = (null)} end 2015-11-02 10:52:26.952 TestSQLite[1644:586342] 0: 1446432746.783269, info: NSThread: 0x147e822c0{number = 2, name = (null)} start 1: 1446432746.952698, cost 0.169429, info: NSThread: 0x147e822c0{number = 2, name = (null)} end 2015-11-02 10:52:26.965 TestSQLite[1644:586343] 0: 1446432746.804017, info: NSThread: 0x147d65b30{number = 3, name = (null)} start 1: 1446432746.965503, cost 0.161486, info: NSThread: 0x147d65b30{number = 3, name = (null)} end "4-threads" still take 60-70% slower. ???? ???:Simon Slavinslavins at bigfraud.org ???:SQLite mailing listsqlite-users at mailinglists.sqlite.org ????:2015?11?2?(??)?10:45 ??:Re: [sqlite] Why SQLite take lower performance inmulti-threadSELECTing? On 2 Nov 2015, at 2:19am, sanhua.zh sanhua.zh at foxmail.com wrote: it seems that this mail list will filter my code. I re-send it now. It?s written by Objective-C and C, but it?s quite simple to understand. There's nothing wrong with your code. Well actually there is (you don't test the values returned by all the SQLite calls) but that will not affect what we're discussing. Please compare times taken by your program when you use 'WAL' mode vs. using 'DELETE' mode. Simon. _______________________________________________ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users