22.12.2011, 01:12
Quote:
Actually, I think SQLite is faster in SA-MP than the MySQL plugin is for executing queries.
|
I really only learned enough SQL to get by, so my knowledge of optimizations/engines isnt as good as it SHOULD be. There may even be ways to speed up MySQL as well, im not entirely sure. Either way though, with the option to thread queries (i didnt do so in these tests) i think MySQL is the best choice.
Quote:
Originally Posted by Kyosaur
Code:
[20:54:29] SQLite test starting... [20:54:42] SQLite Insert: 100 queries in 12684 ms [20:54:42] SQLite Select: 100 queries in 25 ms [20:54:42] >> SQLite Last select result: STRRRRRRRRRRRRIIIIIIIIIIIIIIIIIIING TEEEEEEEEEST [20:54:56] SQLite Update: 100 queries in 13692 ms [20:54:56] MySQL test starting.... [20:54:56] MySQL Insert: 100 queries in 35 ms [20:54:56] MySQL Select: 100 queries in 39 ms [20:54:56] >> MySQL Last select result: STRRRRRRRRRRRRIIIIIIIIIIIIIIIIIIING TEEEEEEEEEST [20:54:56] MySQL Update: 100 queries in 133 ms http://pastebin.com/BCn3KdSc Edit: By adding this line SQLite was speed up dramatically (Credits to cessil for the line): Code:
db_query(g_Sqlite, "PRAGMA synchronous = OFF" ); Code:
//test 1 [07:15:29] SQLite test starting... [07:15:30] SQLite Insert: 100 queries in 519 ms [07:15:30] SQLite Select: 100 queries in 12 ms [07:15:30] >> SQLite Last select result: STRRRRRRRRRRRRIIIIIIIIIIIIIIIIIIING TEEEEEEEEEST [07:15:30] SQLite Update: 100 queries in 342 ms [07:15:30] MySQL test starting.... [07:15:30] MySQL Insert: 100 queries in 23 ms [07:15:30] MySQL Select: 100 queries in 34 ms [07:15:30] >> MySQL Last select result: STRRRRRRRRRRRRIIIIIIIIIIIIIIIIIIING TEEEEEEEEEST [07:15:31] MySQL Insert: 100 queries in 120 ms //test 2 [07:15:50] SQLite test starting... [07:15:50] SQLite Insert: 100 queries in 439 ms [07:15:50] SQLite Select: 100 queries in 11 ms [07:15:50] >> SQLite Last select result: STRRRRRRRRRRRRIIIIIIIIIIIIIIIIIIING TEEEEEEEEEST [07:15:50] SQLite Update: 100 queries in 343 ms [07:15:50] MySQL test starting.... [07:15:50] MySQL Insert: 100 queries in 24 ms [07:15:51] MySQL Select: 100 queries in 34 ms [07:15:51] >> MySQL Last select result: STRRRRRRRRRRRRIIIIIIIIIIIIIIIIIIING TEEEEEEEEEST [07:15:51] MySQL Insert: 100 queries in 119 ms |