Optimization Related Question
#1

Before I proceed, I'd like to point out this isn't a post asking for scripting help. My purpose here is to get a firmer grasp on PAWN's logic (specifically in the area of resource usage).

Anyway, I had written out a function to load up a bunch of rows from a MySQL database. Naturally, this information was dropped into a variable for use elsewhere. Now, that works fine, but I wanted to try and make it work more dynamically. So, for example's sake, let's say I was loading up houses or something like that. I'd probably save it in something that looks like:

Код:
#define MAX_STUFF 100 //Because 100..

enum sInfo {
	Float:X,
	Float:Y,
	Float:Z,
	interior
	//etc
}

new info[MAX_STUFF][sInfo];
Well, it occurred to me that I may or may not go over 100 at some point. I could set "MAX_STUFF" to a larger number, but my idea was to try and set it up so that I could add more while the gm is running. So then I tried doing this for the hell of it:

Код:
new info[][sInfo];
So my question comes down to this I guess:

What are the implications of making a variable like this? (In both how it works and how it will affect server resources)

..and incidentally, I went through the pawn manual in an attempt to understand this, but I found the information to be lacking.
Reply


Messages In This Thread
Optimization Related Question - by elcid7772 - 23.08.2013, 05:01
Re: Optimization Related Question - by Vince - 23.08.2013, 07:34
Re: Optimization Related Question - by AndreT - 23.08.2013, 07:41

Forum Jump:


Users browsing this thread: 1 Guest(s)