Optimizing questions
#7

Quote:
Originally Posted by TehEbil
Посмотреть сообщение
4) well, i declared those vars global on top of the script, so it should work, like my format function.
5) Sure they don't? As I know they take more space if they are bigger. So the question is: Is string[127] bigger than string[120] ? For the first view I'd say yes, but in the RAM, I read/understood they use degree's of 2, so 128.
Maybe it's clearer with the following question: string[127] and string[128], is the difference high? Means: It's just 1 byte or 129 byte untill the next degree of 2nd is reached?

6)
Okay, that's nice to hear.

To your edit:
A ZCMD-function should return 0 if it success?


For sure, I look forward to hearing more different oppinions

edit:
damn, didn't wanted to post twice, wanted to edit in my other post but Іlate.

@Silent
Well, but I think its senseless to create 1000 times a string, if just one would do, too. For sure, it depends on which it is used for ( for chat ~ 127, for commands just 16 or sth. like that ).

ups, mixxed up global with local, so nvm ^^
4). You can do that, its fine to use global variables, just be careful :P.

5). They are bigger in size yes. The bigger the array is, the more memory you use. This has nothing to do with powers of two (it just so happens 128 and 256 are common sizes). You can get the number of bites an array uses by multiplying all of the number of cells by 4. So "new string[500];" would take roughly 2kb of ram (500*4), which is nothing lol, and "new string[500][500];" would take roughly 1mb of ram ((500*500) * 4).

6). I dont know off the top of my head, i dont use zcmd lol. You'd have to check in the topic.
Reply


Messages In This Thread
Optimizing questions - by TehEbil - 22.01.2011, 13:15
Re: Optimizing questions - by Macluawn - 22.01.2011, 13:32
Re: Optimizing questions - by Kyosaur - 22.01.2011, 14:14
Re: Optimizing questions - by TehEbil - 22.01.2011, 14:31
Re: Optimizing questions - by Joe Staff - 22.01.2011, 14:47
Re: Optimizing questions - by TehEbil - 22.01.2011, 14:51
Re: Optimizing questions - by Kyosaur - 22.01.2011, 15:35
Re: Optimizing questions - by TehEbil - 22.01.2011, 15:48
Re: Optimizing questions - by Joe Staff - 22.01.2011, 16:47
Re: Optimizing questions - by dice7 - 22.01.2011, 17:14

Forum Jump:


Users browsing this thread: 3 Guest(s)