SQLite Lag
#3
Three seconds sounds like a serious issue. Does it happen every time, or is it only occasional? We're doing much harder work with SQLite in other plugins and it has no such performance problems. What platform are you using? Debug or release build?

Also please note that your code is kinda vulnerable to SQL injection. You should never put external strings into the query, but rather use prepared statements and placeholders:
local stmt = DB:prepare("UPDATE money SET money = ? WHERE uuid = ?")
stmt:bind_values({Money, PlayerUUID})  -- Binds the question-marks in the previous query to actual values
stmt:step()  -- Execute the DB query
stmt:finalize()  -- Free up the resources
This is so common that most plugins wrap it in a helper function. In the Gallery plugin that SphinxC0re linked, it's here: https://github.com/cuberite/gallery/blob...a#L79-L107
Reply
Thanks given by:


Messages In This Thread
SQLite Lag - by gegi123 - 10-31-2015, 04:35 AM
RE: SQLite Lag - by sphinxc0re - 10-31-2015, 07:11 AM
RE: SQLite Lag - by xoft - 10-31-2015, 08:22 AM
RE: SQLite Lag - by gegi123 - 10-31-2015, 10:33 PM
RE: SQLite Lag - by xoft - 11-01-2015, 12:11 AM
RE: SQLite Lag - by NiLSPACE - 11-01-2015, 12:27 AM
RE: SQLite Lag - by gegi123 - 11-01-2015, 01:23 AM
RE: SQLite Lag - by xoft - 11-01-2015, 07:42 AM
RE: SQLite Lag - by gegi123 - 11-01-2015, 07:57 AM
RE: SQLite Lag - by xoft - 11-01-2015, 08:08 AM
RE: SQLite Lag - by gegi123 - 11-01-2015, 08:37 AM
RE: SQLite Lag - by NiLSPACE - 11-10-2015, 10:42 PM
RE: SQLite Lag - by Seadragon91 - 11-10-2015, 11:20 PM
RE: SQLite Lag - by xoft - 11-11-2015, 12:55 AM



Users browsing this thread: 2 Guest(s)