Java Performance Tuning Flashcards

1
Q

Which are possible ways to improve percieved performance and appear quicker?

A

1) Threading to appear quicker - Try to respond to the request immediately even if the work is big, do that in background. So that the application is responsive. Separate UI thread and background processing threads.
2) Streaming to appear quicker - Just like browser, load the data that can be loaded first (text) and then load the other data in background. This strategy is particularly useful for distributed applications, where getting all data at once can take a lot of time.
3) Caching to appear quicker - Optimization technique. hardware cache, operating system read and write cache, cached filesystems and file reading and writing buffered in application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which is most important condition when taking measurements?

A

While running benchmarks the conditions should remain as same as possible.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Warmup period

A

You must give warmup period to the application before you start measuring. So that during that time the JVM warms up and caches are warm.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The problem with simulating artificial scenario and not user scenario

A

If we don’t simulate real scenario they we may get superficially good performance. So all the requests may end up being served from cache but in real scenario the user behavior might be very different.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the things that can be measured for performance?

A
  • CPU time
  • CPU utilization
  • No of processes waiting for CPU (gives idea of contention)
  • Paging of processes
  • Memory sizes
  • Disk throughput
  • Disk scanning times
  • Network traffic, throughput, latency
  • Transaction rates
  • etc
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How large should be heap?

A

Heap should not be so large that physical memory is swamped and system has to start paging. So maximum heap size should be less than physical memory (RAM).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly