20 Mei 2013

HEAP, JAR, FPS Optimizations


Which ones are equal? 
1. 32/4
2. (8 >> 2) << 4
3. 2^5
4. 128 >>> 2
5. 2 >> 5



Options:
A: 1 and 2
B: 2 and 4 \\\\\\\\\\\\\\\\\\\\\\\\\\\
C: 1 and 3
D: 2 and 3

1.  Option A
2.  Option B \\\\\\\\\\\\\\\\\\\\\\\\\\\
3.  Option C
4.  Option D

What is the output of this piece of code? 

int m = 0;
while(++m < 2)
{
System.out.println(m);
}

1.  1\\\\\\\\\\\
2.  2
3.  3
4.  4


What's wrong with this code? 

public class MyClass extends Class1, Class2 implements Interface1, Interface2
{
// ...
}

1.  The code are not complete
2.  Java call polymorphism method
3.  Code error in compile
4.  Java doesn't support multiple inheritance.\\\\\\\\\\\\\\\\\\\\\\

Choose all valid answers and put them in order from fastest to slowest
a. a = a + a + a + a + a;
b. a = 5 * a;
c. a = a * 4 + a;
d. a = (a << 2) + a;

1.  a > b > c > d
2.  d > b > c > a\\\\\\\\\\\\\\\\\\\
3.  d > a > b > c
4.  d >c > b > a


What is the output of this piece of code? 
What gets printed on the standard output when the class below is compiled and executed.
public classShortCkt
{
public static void main(String args [] )
{
int i = 0;
boolean t = true;
boolean f = false, b;
b =(t & ((i++) == 0));
b =(f & ((i+=2) > 0));
System.out.println(i);
}

}

1.  1
2.  2
3.  3\\\\\\\\\\\\\\\\\\\
4.  4

Why we have to cache some image before draw it to the screen?

1.  compressing procces of module image are CPU consuming and result in a significant FPS drop
2.  Decompressing procces of module image are CPU consuming and result in a significant FPS drop\\\\\\\\\\\\\\\\\
3.  Decompressing procces of module image are fast in CPU and result in a significant FPS Increase
4.  Compressing procces of module image are fast in CPU and result in a significant FPS Increase



Why we need to always check visibility of an object before drawing it on screen?

1.  Because even if it's drawn outside the screen, the calculation time is still able to reduce CPU performance\\\\\\\\\\\\\\\
2.  Because even if it's drawn outside the screen, the calculation time is still able to increase CPU performance
3.  Because even if an object drawn outside the clipping area, the calculation time is zero.
4.  All the answer is wrong



what is TMP_BUFFER_SIZE?

1.  size of a temporary RGB array when decoding sprite's image\\\\\\\\\\\\\\\\\\
2.  size of a buffer when loading sprite
3.  size of temporary image when caching sprite
4.  size of largest module in the sprite

What problem can occurs if we reduce heap by not caching sprites?

1.  no problem
2.  FPS will drop\\\\\\\\\\\\\\
3.  longer loading time
4.  sprite need to be loaded every time we call Draw methods



How to optimize memory consumption of Sound Player?

1.  create and prefetch Player at Loading
2.  use thread for sound player
3.  load sound data as byte array\\\\\\\\\\\\\\\\\\
4.  split sounds in different data package



How to optimize bytecode size?

1.  use overloadaggressively in Proguard
2.  remove dead code
3.  change member variables to static if possible
4.  all correct\\\\\\\\\\\\\\\\\\\\\\\\\\



What is the fastest way to find largest module in a Sprite ?

1.  using Tools > Modules Usage in Aurora GT\\\\\\\\\\\\\\\\\\\\\\
2.  using Search Module function (ctrl+F) in Aurora GT
3.  using external tools, not using Aurora GT
4.  using Tools > Statistics in Aurora GT


What tools that we can use for optimized JAR? 
1. Proguard
2. 7Zip
3. AuroraGT
4. PNGout

Answer : 1,2,3 \\\\\\\\\\\\\\\\\\\\\\

When we need to use the flag BS_FM_PALETTE ?

1.  when we need to modify palette in code using SetCurrentPalette
2.  when we have Frames with different palette in it's FModule\\\\\\\\\\\\\\\\\\\\\\\
3.  when we have more than one palette in the sprite
4.  when we want to export sprite that contain multiple images with palette for each image

What output that can be generated by SPRCMD (sprite command) ?

1.  binary sprite file\\\\\\\\\\\\\\\\\\\\\\\\
2.  log file
3.  source code file(*java, *.cpp or *.cs)
4.  all correct

What LZMA used for?

1.  Uncompress data using LZMA algorithm
2.  Compress data using LZMA algorithm
3.  Compress and Uncompress data using LZMA algorithm \\\\\\\\\\\\\\\\\\\\\\\\
4.  All the answer is wrong



These are some AuroraGT features :
1. Best fitting modules
2. Dividing modules
3. Removing hidden FModules
4. Removing unused Frames / Modules
5. Using flipped/rotated modules
6. Hyperframes

Which are from features above can be used to optimize Memory?

1.  1, 2, 3, 4
2.  1, 2, 3, 4, 5
3.  1, 2, 3, 4, 5, 6\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
4.  1, 3, 4, 5


Bila ada pertanyaan kritik dan saran, silahkan tulis pada kolom komentar..

HEAP, JAR, FPS Optimizations

Kamu sedang membaca Artikel tentang HEAP, JAR, FPS Optimizations Silahkan baca artikel Modifikasi Fairing Motor Tentang artikel modifikasi, upgrade mesin, speed dan yang lainnya. Kamu boleh menyebar Luaskan atau MengCopy-Paste jika Artikel ini sangat bermanfaat menurutmu, Tapi jangan lupa untuk meletakkan Link http://iotomotifinfo.blogspot.com/2013/05/heap-jar-fps-optimizations.html Sebagai sumbernya

0 komentar:

Posting Komentar

Komentar adalah tanggapan pribadi, tidak mewakili kebijakan editorial redaksi. Modifikasi-id berhak mengubah atau menghapus kata-kata yang berbau pelecehan, intimidasi, bertendensi suku, agama, ras, dan antar golongan.