AMX Size [Header/Code/...]
#1

Hello.
We are few developer who works on a new gamemode whith the idea of an old gamemode (both are private).
We faced up to on a problem about compiler infos. We are like 25-30% of the new gamemode.
The oldgame compile with those infos:
Код:
Header size:          22200 bytes
Code size:          6054788 bytes
Data size:         10716556 bytes
Stack/heap size:      50000 bytes; estimated max. usage=12298 cells (49192 bytes)
Total requirements:16843544 bytes
There is no optimization and no new usefull include are used (foreach, zcmd, ...).
So.. The new gamemode have this:
Код:
Header size:          15744 bytes
Code size:          1027576 bytes
Data size:          6641048 bytes
Stack/heap size:      16384 bytes; estimated max. usage=2363 cells (9452 bytes)
Total requirements: 7700752 bytes
Код:
#include "..\includes\a_mysql"			// R41			https://github.com/pBlueG/SA-MP-MySQL/nl...85#include "..\includes\streamer"			// 2.8.2		https://github.com/samp-incognito/samp-s...85#include "..\includes\sscanf2"			// 2.8.2		https://github.com/maddinat0r/sscanf/nl6...85#include "..\includes\izcmd"			// 0.2.3.0		https://sampforum.blast.hk/showthread.ph...85#include "..\includes\colandreas"		// 1.4.0		https://github.com/Pottus/ColAndreas/nl6...85#include "..\includes\mSelection"		// 1.1			https://sampforum.blast.hk/showthread.ph...85#include "..\includes\YSF"				// R19			https://sampforum.blast.hk/showthread.ph...85#include "..\includes\YSI\YSI_data\y_foreach"
I'm posting here because I found this http://forum.sa-mp.com/showpost.php?...06&postcount=2 from Vince.

I think the problem come from a lot of Iterator + 2D / 3D arrays (we don't use 4D arrays since it's too heavy). Have you any ideas, tips or something?
Reply
#2

Bump!
Reply
#3

If there is no lag and too much memory usage, It'll be no problem.

Here is mine: (optimized)

Код:
Header size:          19516 bytes
Code size:          1584804 bytes
Data size:          3456804 bytes
Stack/heap size:      16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements: 5077508 bytes
Reply
#4

Just don't make large local arrays or if you still need to then use packed arrays.
Reply
#5

I think Iterators are the main source of this problem.
I'll use a for loop with the classic boolean "IsCreated" in the enum of the variable.
Reply
#6

Totally, It happened to me before, It completely means that you've reached the limit of string size, I am not sure of that but when it was happening to me, I tried that an it works.
Reply
#7

Quote:
Originally Posted by Beryllium
Посмотреть сообщение
Totally, It happened to me before, It completely means that you've reached the limit of string size, I am not sure of that but when it was happening to me, I tried that an it works.
Iterator was the problem?
Reply
#8

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Iterator was the problem?
There's nothing to do with the iterators. One thing that most people do is save player's stats on disconnect so it's a long query and they use like 2048 cells. Just use packed arrays or don't make them too big and you are good.
Reply
#9

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
There's nothing to do with the iterators. One thing that most people do is save player's stats on disconnect so it's a long query and they use like 2048 cells. Just use packed arrays or don't make them too big and you are good.
No'p. As I said previously, I already optimized all of my "string". This is the most important part of optimization.
PHP код:
    new query[75];
    new 
query[220];
    new 
query[100];
... 
I'm pointing the fact I'm using Iterator because I've a lot of Iterator (single/multi dimensions). In ******'s include internal, it's creating also array (for multi-dimensional array, it's bigger : size1 + size2)
Soo.. I've a lot of multi-dimensional array with, sometimes, a big size (1300 for MAX_VEHICLES). At the end, that take a lot of memory usage/...
Reply
#10

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
No'p. As I said previously, I already optimized all of my "string". This is the most important part of optimization.
PHP код:
    new query[75];
    new 
query[220];
    new 
query[100];
... 
I'm pointing the fact I'm using Iterator because I've a lot of Iterator (single/multi dimensions). In ******'s include internal, it's creating also array (for multi-dimensional array, it's bigger : size1 + size2)
Soo.. I've a lot of multi-dimensional array with, sometimes, a big size (1300 for MAX_VEHICLES). At the end, that take a lot of memory usage/...
The Iterators are global and do not affect the size of the stack. And the Data Size (this is where global Variables and Arrays are stored) is also not even close to what some modes use (and they work totally fine).

Your stack/heap est. max usage is also not very high, you didn't even use #pragma dynamic..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)