amx size
#1

Well,i have made a login and register with mysql and 4 commands using zcmd and a big system with dialogs and saving/loading for objects,and then amx size went to 2500 kb,and .pwn is 59 kb,why did it increase that much and will it effect on the server?
Reply
#2

Hi iBots,

I am speaking strictly from personal experience only; I don't believe that the file size of your .pwn or .amx should have any effect on the performance of your server. The larger your .pwn becomes the larger your .amx will become as you fill your gamemode with more data and it is important that you optimize your gamemode script especially when you start heading into the thousand's of lines as the more content you have the higher amount of resources you will be using and more work your server will be doing.

To re-iterate, only speaking here from personal experience.
Reply
#3

When I used to have Y_INI, my amx file was ~4mb. As I am aware of, it doesn't affect the server.

Edit, a bit late.
Reply
#4

When the compiler compiles something, it reorganizes the code, slots things there and there to allow it to work. Basically there's additional data required to run it as an actual gamemode from the server's client. However, 59kb to 2500kb is reasonably large, are you sure you do not have any includes doing this?

The data size does determine on performance however it doesn't take a massive impact. Think of it as a graphical image, high quality vs low quality. High quality requires more file size, however takes longer to load. In terms of SAMP though, compare the gamemode with the size of an image!
Reply
#5

well,i got these includes
pawn Код:
a_samp
a_mysql
ZCMD
sscanf2
streamer
NOTE:well i got saving and loading for the system,this system took around 1k lines(i mean the system is like 1k lines),and the gamemode is more than 1500 lines for now.
Reply
#6

I have more than 6 includes and 5 plugins and 100K lines and the AMX size reaches 10MB+... And as long as its optimized, It doesn't affect performance at all.
Reply
#7

What's the size before you compiled it?
Reply
#8

Amx size doesn't depends on how many includes/plugins or what not you use.

It depends on how you write your code.


you can open pawno, write in
pawn Код:
#include <a_samp>


main()
{
new a[100000000];
}

Compile and it will be a big amx file, always redefine MAX_PLAYERS to your slot amount, because MAX_PLAYERS by default is 500
Reply
#9

Well, you can't create an array having size over 2048.
Also, if you already used MAX_PLAYERS at many places, then just add this code on the top of your script:
pawn Код:
#undef MAX_PLAYERS
#define MAX_PLAYERS 50 (change 50 to your server slot)
Reply
#10

Of course you can! The limit is only your heap size, which can be adjusted with #pragma dynamic (not recommended of course). 2048 is limit for dialog main body text.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)