Slow DB writes
Slow DB writes
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
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
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.
-
- Posts: 186
- Joined: Sun Nov 14, 2010 5:57 am
Re: Slow DB writes
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
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
Transactions fixed the problem quite nicely, zero slowdown now. And to think I believed I wouldn't have a use for them in Mudlet.