Page 1 of 1

Slow DB writes

Posted: Thu May 12, 2011 11:07 pm
by Sanaki
While in general I understand tables can be used for most database functions, this isn't always feasible. However, after setting up a system which appeared to work fine, I ran into an issue with major slowdown whenever I had to do multiple updates in rapid succession. I just put it into a time tester, and 10 sets in a row of "fetch, update", over twenty tests, have an execution time of 0.86 seconds at -best-, reaching as high as 1.108 seconds on the worst. From what I can tell, this is because as opposed to a standard database, this is actually doing a file write on every update. Thing is, this lag is freezing the entire client during the delay, not just causing a delay in the connection or somesuch. Is there any way to load the file into RAM and have it only updated at a set interval or somesuch? Or alternatively, is this a behavior that can be fixed in a future version of Mudlet? I'd just move it to using the database I already have running on this computer, but that effectively destroys my ability to export it to other players.

Re: Slow DB writes

Posted: Thu May 12, 2011 11:29 pm
by Vadi
It's not broken, it's your slow HDD. You can disable automatic writes to the disk, see "Transactions" section of the db manual, or get an SSD.

Re: Slow DB writes

Posted: Thu May 12, 2011 11:50 pm
by Sanaki
Huh. Somehow hadn't thought about using transactions that way. Much appreciated! And for the record, I'd love an SSD. It's my wallet that's being all stingy on me.

Re: Slow DB writes

Posted: Fri May 13, 2011 12:25 am
by Vadi
Same :(

Re: Slow DB writes

Posted: Fri May 13, 2011 12:49 am
by Yetzederixx
Load your database contents into a table and do your work with that if possible, that's how I do it.

Re: Slow DB writes

Posted: Fri May 13, 2011 1:15 am
by Sanaki
If that were reasonable, there'd be no reason for me to keep the database usage for this at all. I'd just store it in a persistent table.

Re: Slow DB writes

Posted: Fri May 13, 2011 7:08 am
by Sanaki
Transactions fixed the problem quite nicely, zero slowdown now. And to think I believed I wouldn't have a use for them in Mudlet.