Software Developer and Performance Engineer
Posts tagged java
Develop Code with Performance Testing In Mind
Jun 22nd
Performance testing is usually done toward the end of a project, or worse, only when performance is found to be less than ideal. There is little time to get things done, and there is a lot of pressure to deliver on time. The testing team is usually under a lot of pressure to get things done. There are a number of things a developer can do that can make a huge difference for the testing team.
- Name all the components of a Swing application. Many testing frameworks for Swing use names to identify components. If there are no names provided, it becomes more difficult to make tests that work with the application. The tester must find another way, usually by traversing the object hierarchy, to find a component.
- Make use of an INFO logging level. Tools like Log4J have a number of levels for writing information to files. Writing information useful to testers at this level means they can search logs for the information they are looking for. Success messages, method names, class names, anything that a tester may be looking for can be output in this manner.
- Another useful item that can be output at the INFO level is performance information. Putting this data out in a format that is easily extracted can provide a way to determine where a performance problem is.
- Provide helper and utility classes. These special objects can provide an API to the system that is easier to use and understand. It most likely won’t provide full access to the system’s features, but it will be much easier to use and can give testers an easier time to test the system. If developers are following Agile methods such as test first design, these tests should be made available to the testing team. Granted, these are only useful for people who know how to write code, but frequently the developer becomes the tester on a project and having these special objects can make a tedious job more bearable.
- Interview the test team and find out what problems they run into. Their view of the system is much different than the developer’s and could lead to a solution that is better for everyone. Frequently the things they want which will make their lives easier, turn out to make developers lives easier as well.
Java SE 6 Update 14 Performance Improvements – One Not Free
May 29th
Java SE 6 Update 14 Performance Improvements – One Not Free
Sun has just released Java SE 6 Update 14 with some great performance improvements.
- Optimization Using Escape Analysis :
[-XX:+DoEscapeAnalysis]
HotSpot will look for objects that are created and reference by a single thread and omit allocation treating them like local variables. - Compressed Object Pointers :
[-XX:+UseCompressedOops]
Improves 64-bit JRE performance by compressing object references to 32 bits when the object heap is less than 32 GB. - Garbage First (G1) Garbage Collector :
[-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC]
A low pause, server style collector that is more predictable. - Improved TreeMap Iteration :
[-XX:+AggressiveOpts]
Improved iteration for frequent passes over TreeMaps when the option is turned on.
Release notes indicate though that to use the G1 garbage collector in production, a Java support contract must have been purchased. I guess Oracle is starting to make its mark on Sun.