Flashcards in Java Performance Tuning Deck (6)
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.
Which is most important condition when taking measurements?
While running benchmarks the conditions should remain as same as possible.
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.
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.
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