Using char on variables
#3

test1.pwn
pawn Код:
#define FILTERSCRIPT

#include < a_samp >

new
    a[ 2000 ],
    b[ 2000 ],
    c[ 2000 ],
    d[ 2000 ],
    e[ 2000 ]
;

public OnFilterScriptInit( )
{
    for( new i; i != 2000; i++ )
    {
        a[ i ] = 200;
        b[ i ] = 200;
        c[ i ] = 200;
        d[ i ] = 200;
        e[ i ] = 200;
    }
    return 1;
}
pawn Код:
Header size:            116 bytes
Code size:              468 bytes
Data size:            40000 bytes // <--
Stack/heap size:      16384 bytes; estimated max. usage=9 cells (36 bytes)
Total requirements:   56968 bytes // <--
test1.amx -> size: 10,5 KB

---

test2.pwn
pawn Код:
#define FILTERSCRIPT

#include < a_samp >

new
    a[ 2000 char ],
    b[ 2000 char ],
    c[ 2000 char ],
    d[ 2000 char ],
    e[ 2000 char ]
;

public OnFilterScriptInit( )
{
    for( new i; i != 2000; i++ )
    {
        a{ i } = 200;
        b{ i } = 200;
        c{ i } = 200;
        d{ i } = 200;
        e{ i } = 200;
    }
    return 1;
}
pawn Код:
Header size:            116 bytes
Code size:              488 bytes
Data size:            10000 bytes // <--
Stack/heap size:      16384 bytes; estimated max. usage=9 cells (36 bytes)
Total requirements:   26988 bytes // <--
test2.amx -> size: 3,23 KB

---

You're now able to see huge difference!
Reply


Messages In This Thread
Using char on variables - by ||123|| - 24.11.2013, 11:37
Re: Using char on variables - by Patrick - 24.11.2013, 11:42
Re: Using char on variables - by Konstantinos - 24.11.2013, 11:59
Re: Using char on variables - by Djole1337 - 24.11.2013, 13:37
Re: Using char on variables - by Ada32 - 24.11.2013, 13:46

Forum Jump:


Users browsing this thread: 2 Guest(s)