Databases.

by Thorgal

Back to Mechanic's Corner.

Thorgal2005-04-19 18:09:52
Currently I'm use stringlists for my curing, %ismember and stuff, which works very effectively, but since I'm on a neverending quest for speed, does anyone know whether databases are faster than stringlists, or not?
Unknown2005-04-19 18:50:15
Theoretically, data records should be faster than string lists, since they are indexed with a key rather than searching through every item for a match. It all depends on how Zugg implemented them internally, of course.
Terenas2005-04-19 18:51:26
If you want fast speed, why not just switch to Mushclient? happy.gif
Unknown2005-04-19 18:54:04
Amen.
Asarnil2005-04-19 19:10:52
I would consider switching to Mush, but I can't code for censor.gif , haven't even done pseudocode in the last 10 years and only have my average understanding of zmud scripting to go on.

That and Ethelon never bloody sends me his system no matter how many times I PM or wait for him to come online over AIM.

EDIT: Watch your language. ~Shiri~
Gwylifar2005-04-19 19:28:13
Database variables are faster when you're storing key and value pairs and indexing on the key to get the value; but if you're just storing a list, a list variable is going to be faster.
Thorgal2005-04-19 19:30:33
QUOTE(terenas @ Apr 19 2005, 08:51 PM)
If you want fast speed, why not just switch to Mushclient?  happy.gif
102581



When I want to code a script using 9 pages when I could have done it in 3 lines, I'll use mushclient.

And thanks Gwylifar, sticking to what I have now, which is still faster than anyone else's system ninja.gif .
Unknown2005-04-19 20:51:49
QUOTE(Thorgal @ Apr 19 2005, 02:30 PM)
When I want to code a script using 9 pages when I could have done it in 3 lines, I'll use mushclient.


Some stuff can be done in MUSHclient using much less code than zMUD. It all depends on what you're doing and how you try to do it. The thing is, MUSHclient's nine pages of script will still execute faster than zMUD's three lines. laugh.gif
Daganev2005-04-19 20:55:11
databases are only good if your going to have a multidimensional array, otherwise a stringlist is faster.
Unknown2005-04-19 21:47:17
When I was trying data records in zmud it was often getting messed up.
It could be my fault, I could've been doing something wrong, but I don't trust them anyway.
Gwylifar2005-04-20 02:29:06
I use them lots. They work a treat.
Sylphas2005-04-21 05:59:19
I'm really starting to love them. Most of my subsystems are based off of them (channel colors, balance line colors, storage, enchantments, rune scribing, etc). They're very very handy, if you can make them work right. If you go in like I did, trying to wrestle them into your stringlist oriented code, it's not going to work. But if you make sure to browse a help file or two, you'll be all set to do great things with them.
Unknown2005-04-21 08:38:48
In my experience, using a database variable outruns everything else by far. For example, my powerlog summary script uses a database variable to store data. I had tried the same with a string list initially (as was my habit back then) but I figured that while using #ADDITEM instructions I'd receive a very notable slowdown, lagging me for at least 10 seconds before the whole powerlog was parsed, whereas with #ADDKEY I can parse even longer logs in significantly less itme.

Maybe there's just something weird about my zMud but it's the latest copy and the database beats everything else zMud offers for data storage in terms of speed.

I've actually reached a point where I hardly at all use stringlists anymore, because even doing something like "#ADDKEY mydatabase list %concat(@mydatabase.list,"|",)" processes much faster on my zMud than doing "#ADDITEM mylist " or "#VAR mylist %additem(@mylist, )".

Databases, after all, are designed and optimized for the sole purpose to handle data in large quantities as fast as possible.

However, you have to keep in mind of course that databases can be quite bothersome if you have unknown key names, for example, which isn't a problem you'll have with stringlists, obviously. (Of course, in some cases it's quite possible to just transform a database variable into a stringlist on the fly, If you only need key names and have empty values all the way down that's fairly easy.)
Unknown2005-04-21 08:40:49
QUOTE(Zarquan @ Apr 19 2005, 10:51 PM)
Some stuff can be done in MUSHclient using much less code than zMUD. It all depends on what you're doing and how you try to do it. The thing is, MUSHclient's nine pages of script will still execute faster than zMUD's three lines.  laugh.gif
102735



*envy*

I need more free time to work my way into Mushclient coding, dangnabit
Unknown2005-04-21 17:19:29
In all practical terms, there's no distinguishable difference between MUSHclient and zMUD, at least not that would be detectable in the normal course of gameplay. I'm looking into MUSHClient but I just don't like the GUI it uses for adding stuff... zMUD's little settings editor for adding triggers/aliases/whatever is vastly superior in my opinion
Unknown2005-04-21 17:36:00
The speed actually depends on a number of parameters. I am not sure what is meant by a stringlist,
but it implies a list structure, whereas a database implies a finite map from keys to values. If this is true,
then databases will be faster than stringlists, provided they contain enough data!

Up to a certain point stringlists might actually be faster.

Given the speed of todays computers though and the complexity of the mud I do not think speed is an
important issue, unless the coding in zMud is done in an awfully odd way.

And by the way: I use tinyfugue with quite a script nowadays. And it is growing larger and larger
for each lusternian month, heh.
Unknown2005-04-21 17:45:23
QUOTE(Visaeris Maeloch @ Apr 21 2005, 12:19 PM)
In all practical terms, there's no distinguishable difference between MUSHclient and zMUD, at least not that would be detectable in the normal course of gameplay. I'm looking into MUSHClient but I just don't like the GUI it uses for adding stuff... zMUD's little settings editor for adding triggers/aliases/whatever is vastly superior in my opinion
104215



If you code more than 1000 triggers and make yourself enough failsafes, you'll easily see zMUD start to be slower than MUSHclient. I had aliases that were nested three or four deep in zMUD and that alone was enough to slow my system down noticeably. In MUSHclient, I could have aliases nested ten deep and call them in a timer five times a second and I still wouldn't notice it. Doing complex things in MUSHclient is much easier and faster. Doing simple things isn't enough to tax any program, so you won't notice a difference.

I agree that zMUD's settings editor is more comprehensive and easier to navigate. That's why I do almost all of my MUSHclient settings in a text editor to modify the XML and script files directly.
Unknown2005-04-22 10:27:18
QUOTE(Visaeris Maeloch @ Apr 21 2005, 07:19 PM)
In all practical terms, there's no distinguishable difference between MUSHclient and zMUD, at least not that would be detectable in the normal course of gameplay. I'm looking into MUSHClient but I just don't like the GUI it uses for adding stuff... zMUD's little settings editor for adding triggers/aliases/whatever is vastly superior in my opinion
104215



For me Mushclient has always been significantly faster than zMud, even starting at triggerless execution speed.

As far as I know that's also because Mushclient handles mud output differently than zMud, who buffers everything sent first and then parses/outputs it, whereas Mushclient does parsing and output "on the fly". Ergo it at least appears to be faster.

It's not only that though, it does respond to trigger patterns found in the output much faster than zMud from what I can see.

But aye, the interface is the main reason why I haven't really done much with Mushclient yet, I'm too much into zMuds neat trigger explorer *smirk* (allthough the editor itself is horrid. yuck!)
Unknown2008-09-16 06:36:28
Sorry for the necro, but I have a relevant question.

I was wondering how I can store values (data) in Musclient (VB script) and utilize some way to call them later, like forging data for instance. I was messing around with arrays, but I got bogged down with importing the values (apparently I wasnt doing it right). Can someone help me with this?
Unknown2008-09-16 20:17:19
bumpsauce