Raised This Month: $ Target: $400
 0% 

nVault vs SQLite


Post New Thread Reply   
 
Thread Tools Display Modes
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 02-14-2011 , 04:24   Re: nVault vs SQLite
Reply With Quote #21

Quote:
Originally Posted by Hawk552 View Post
I'm not at all saying that you shouldn't use it. Just be aware that it's insanely slow compared to nVault. SQLite is still far more robust, powerful and portable than nVault. Remember, the topic of this thread was their relative speeds.
Yes I am completely aware of that, but I my opinion the server must run as swiftly as possible. If a query takes too long the server will end up lagging or loosing data which does not help gameplay experience if you ask me, so speed is an important factor.
The best way of handling data IMHO is with mysql, because of the power, portability and speed, the only problem is that you need an sql server close enough to your server so that queries will not take too long.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
konichiwa
New Member
Join Date: Sep 2010
Location: For those who want to re
Old 02-14-2011 , 06:44   Re: nVault vs SQLite
Reply With Quote #22

Surprisingly Sql vs NoSql flamebait made it here, okay Ill bite for the lulz.

Technically NoSql (nVault in this case) will outperform Sql just because its simplicity. It doesnt have complex Sql query parser and the overhead of translating query into result.

However nVault does have limited capability (key-value only), which in comparison Sqlite does much much more than just braindead kv pair. You can perform complex JOIN UNION and stuff which I believe doesnt fit into 90% of your typical Amxmodx needs. [citation needed]

tl;dr summary:
If nVault suits your need, use it. If your code grows over a page worth of query, then consider Sqlite. We dont use Sqlite because it's fast, we use it just because we need to.

And no, threaded queries has nothing to do with performance here. It's simply delegating the query to another worker thread so it doesnt block critical code, giving the illusion of smoothness.

Last edited by konichiwa; 02-14-2011 at 06:44. Reason: typo
konichiwa is offline
Old 02-14-2011, 13:22
Hawk552
This message has been deleted by Hawk552.
Old 02-14-2011, 14:53
hleV
This message has been deleted by Hawk552.
Old 02-14-2011, 15:17
01101101
This message has been deleted by Hawk552.
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-14-2011 , 15:55   Re: nVault vs SQLite
Reply With Quote #23

Quote:
Originally Posted by 01101101 View Post
Ok hawk, you win. However, I did some benchs with a table structure like this

PHP Code:
DROP TABLE benchsqlCREATE TABLE benchsql key2 INTEGER PRIMARY KEYvalue INTEGER 
and read speeds increased A LOT

PHP Code:
L 02/14/2011 16:42:18: [sqltest.amxxSQLiteInit0
L 02
/14/2011 16:42:18: [sqltest.amxxnVaultInsert0
L 02
/14/2011 16:43:41: [sqltest.amxxSQLiteInsert83
L 02
/14/2011 16:43:41: [sqltest.amxxnVaultRead0
L 02
/14/2011 16:43:41: [sqltest.amxxSQLiteRead0
L 02
/14/2011 16:43:41: [sqltest.amxxnVaultClose0
L 02
/14/2011 16:43:41: [sqltest.amxxSQLiteClose
Try it with more records, like 100000 or so. Your results are inconclusive. I always ran my benchmarks to a number of records that were enough for either SQLiteRead() or nVaultRead() to be at least 1. nVault could still be faster even with that structure. They're not the same; the precision of the test was just not enough to draw any conclusions.

Quote:
Originally Posted by 01101101 View Post
Still, nvault is the same at reading, and much faster at inserting. For data read/write, nvault will win. I was actually impressed not by sqlite slowness but nvault speed.
No, we not only can't conclude that from your test results, but it's for an isolated case which nVault isn't even optimized for and that AMXX plugins are rarely going to use. That is, the case where we are 1) associating an integer to an integer and 2) loading the entire table. Neither of those criteria are common, let alone both of them together. Individual fetches are still insanely slow for SQLite compared to nVault.

Quote:
Originally Posted by 01101101 View Post
Maybe (or probabbly) for complex queries (since SQL is not thought for tables like this ones) sql will outperform nvault, however for amxmodx you probabbly will use 99% of times simple queries, so I give this to you too.
Again, you can't even compare those. If nVault doesn't support something, you can't say that "SQLite is faster because it does support it." If you want to implement sorting with nVault, it must be done in Pawn, so then you're benchmarking Pawn to SQLite.

Quote:
Originally Posted by 01101101 View Post
PD: MySQL should be actually slower than SQLite
I think I already said that somewhere but common sense would dictate that, since MySQL has more overhead such as the authentication system and the fact that the server is actually separated from the client.

Quote:
Originally Posted by 01101101 View Post
PD2: Still, fior most cases Id still use SQL (I use MySQL) because "key value" structure is useless for the use I have. 15ms difference arent worth the usefulness of RDBMS. Its like comparing assembly and .net. However, topic was about speed, so, you win.
That wasn't the question or topic.

Quote:
Originally Posted by 01101101 View Post
PD4: What are your pc specs? I have a quad core and you benchmarks took me like 10x longer.
I used my $10/mo VPS server. I don't know the actual specs, but I think that the resources I get allocated actually vary throughout the day.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Old 02-14-2011, 15:58
Hawk552
This message has been deleted by Hawk552.
Old 02-14-2011, 15:59
01101101
This message has been deleted by Hawk552.
Old 02-14-2011, 15:59
Hawk552
This message has been deleted by Hawk552.
Old 02-14-2011, 16:02
01101101
This message has been deleted by Hawk552.
Old 02-14-2011, 16:03
01101101
This message has been deleted by Hawk552.
Old 02-14-2011, 16:06
Hawk552
This message has been deleted by Hawk552.
Old 02-14-2011, 17:04
01101101
This message has been deleted by Hawk552.
Old 02-14-2011, 17:27
Hawk552
This message has been deleted by Hawk552.
Old 02-14-2011, 17:48
ot_207
This message has been deleted by Hawk552.
Old 02-14-2011, 18:13
01101101
This message has been deleted by Hawk552.
Old 02-14-2011, 18:22
Hawk552
This message has been deleted by Hawk552.
Old 02-20-2011, 20:00
Nextra
This message has been deleted by Hawk552.
Old 02-20-2011, 20:04
Exolent[jNr]
This message has been deleted by Hawk552.
Old 02-20-2011, 20:06
Nextra
This message has been deleted by Hawk552.
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-20-2011 , 21:44   Re: nVault vs SQLite
Reply With Quote #24

It reads the file into a hash table and then does the set/get/etc. functions there. When the vault is closed, the information in the hash table is saved to the vault file.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 02-20-2011 , 21:54   Re: nVault vs SQLite
Reply With Quote #25

Ok, obviously SQLite can not stand a chance then. Thanks.
__________________
In Flames we trust!
Nextra is offline
Old 02-21-2011, 08:00
konichiwa
This message has been deleted by Hawk552.
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode