Performance or size ? How to speeding-up the applet?

Hi All,

Can I read from somewhere about how should I make the applet so I can speed it up, and make better by performance and size(memory).

For example what is the difference between:

==================================

private byte[] itemsMenu ={ (byte)'.',(byte)'.',(byte)'.',(byte)'.',(byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.',

(byte)'.',(byte)'.',(byte)'.',(byte)'.',(byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.',

(byte)'.',(byte)'.',(byte)'.',(byte)'.',(byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.',

(byte)'.',(byte)'.',(byte)'.',(byte)'.',(byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.',

(byte)'.',(byte)'.',(byte)'.',(byte)'.',(byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.',

(byte)'.',(byte)'.',(byte)'.',(byte)'.',(byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.',

(byte)'.',(byte)'.',(byte)'.',(byte)'.',(byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.',

(byte)'.',(byte)'.',(byte)'.',(byte)'.',(byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.',

(byte)'.',(byte)'.',(byte)'.',(byte)'.',(byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.', (byte)'.'

};

================== AND ==================================

private byte[] itemsMenu = new byte[90];

for (sI = 0;sI<90;sI++) { itemsMenu[sI] = (byte)'.';

==================================

What I will lose and what I will gain if I use one and another.... memory speed..... and some tips and tricks like this !

Thanks in advice.

Regards,

Zoroto

[1869 byte] By [zorotoa] at [2007-10-2 13:36:16]
# 1

IMHO:

In the first example, array is allocated in memory and filled by '.'

In the second example array is allocated and filled by 0x00. Then, you fills array by '.' sign.

I think, then the first example more quickly, but cap-file will be bigger then in the second example.

AlexRashevskya at 2007-7-13 11:25:19 > top of Java-index,Java Mobility Forums,Consumer and Commerce...