Java Performance Tuning Flashcards Preview

Software Developer Interview Prep > Java Performance Tuning > Flashcards

Flashcards in Java Performance Tuning Deck (6)
Loading flashcards...
1

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

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.

2

Which is most important condition when taking measurements?

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

3

Warmup period

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.

4

The problem with simulating artificial scenario and not user scenario

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.

5

What are the things that can be measured for performance?

- 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

6

How large should be heap?

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).