Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ Effective max size of arrays
|
Effective max size of arrays
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Fletchling
Australia (54 posts) Bio
|
| Date
| Fri 31 Mar 2006 10:12 AM (UTC) |
| Message
| G'day
I have an idea I'd like to try for my mud, but it involves a bunch of arrays of about a 1000 keys each. Any ideas on how I'd measure the performance impact?
In fact, ideas on how I should ask the question (I don't know what I don't know) is probably a better question.
Fletchling | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #1 on Fri 31 Mar 2006 04:58 PM (UTC) |
| Message
| I'm not sure how much a "bunch" is, nor exactly what you plan on doing with the arrays, but several thousand keys shouldn't be a problem.
What matter are things like how many times you loop over the entire array, if you're just doing key lookups, what scripting language you choose, etc. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | | Top |
|
| Posted by
| Fletchling
Australia (54 posts) Bio
|
| Date
| Reply #2 on Fri 31 Mar 2006 10:55 PM (UTC) |
| Message
| bunch = metric term for lots
script language = Lua (I'm sold on Lua)
no loops interrogating each array, just a serial read of each key and value, then some small processing for display formatting. Since the outcome is informational, that is I'm at a point in the mud where I want to make decisions, not millisecond client response, I'm happy with the whole operation taking a second or two.
I was more worried whether there was an overhead to MC just by having a bunch* of arrays. If the pilot works to the satisfaction of my captive bug tester, the arrays may be extended to max size of 10k elements.
Oh, the purpose of this is to explore possibilities for mapping, but that topic has been beaten to death elsewhere so I thought to keep this post to just the code related issues.
*see above definition | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Sat 01 Apr 2006 05:52 AM (UTC) |
| Message
| As Ksilyan says, the important thing is not having them but what you do with them. It is not so much whether MUSHclient will be slow, as whether Lua can handle it, and I would suggest that unless you are accessing millions of items a second, yes it will.
You could write a small test script in the immediate window, making as many table items as you expect (with random or fixed data) and then iterate through it and see how long whatever you are planning to do, takes. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #4 on Tue 04 Apr 2006 07:22 AM (UTC) |
| Message
| Everything Nick said holds; there's also another small consideration which is memory. If you're storing, say, a million keys, each pointing to an integer, you'll be using at least four megabytes of memory (if not in fact more like eight). Like I said, though, that's a fairly small consideration, because four or eight (or even twenty) really isn't a whole lot of memory.
But as Nick said, the best way to find out for sure is simply to run the script and see what happens. I suspect it won't be too bad, and I doubt it'll take a whole second, but again that depends on what exactly is being done to the data. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | | Top |
|
| Posted by
| Fletchling
Australia (54 posts) Bio
|
| Date
| Reply #5 on Tue 04 Apr 2006 11:57 PM (UTC) |
| Message
| It's all true.
I created an array bigger than I can count and MC didn't blink. If the result of this work actually looks any good from a mud player's perspective, I'll post the purpose, method and outcome. First of all I have to get it past the captive bug-tester girl.
Thanks guys.
[doffs 'is 'at] | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
20,583 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top