Performance Engineering in Practice
Performance Engineering is a crucial topic for an individual or a company who is looking to transform the mindset from developer to engineer. In a typical service or product development life cycle the performance consideration comes bit later and also its managed by separate teams most of the times. This kind of practice will create a huge impact on your cost model and the platform evolution plan.
Analysts predict that by 2021, organizations that focus on performance engineering in their application development will outperform competitors that have not made that shift.
Start Early, Do Continuously
Performance requirements and Service Level Objectives(SLO) should be drafted along with your business requirements and Test plan Development for performance also should go hand in hand. When you understand your business/domain you can’t separate how it has to perform in the real world. For example, in a typical e-commerce business shopping cart performance is inseparable and its one of the key business metrics for you.
Once you define the Test Plan and business metrics then the performance analysis will play a crucial role. Performance Analysis is a continuous process and it has to be treated similar to your Integration or Functional tests. The more often you repeat these tests your feedback loop will be shorter. Also these analysis results will help you to tune your test plan and metrics as you learn and understand your domain deeper.
Understand your root well
We can’t do an effective performance engineering without knowing the underlying Hardware and Software where your application is running. In the last two decades Hardware Management evolved from Bare Metal to Managed services in cloud environment, similarly nowadays most of the application also developed in a highly distributed environment. Understanding these evolutions are highly important to practice Performance Engineering.
Let’s take an example with Java Application Stack as shown below.
The Hardware layer comprises of CPU, Disk & Memory and the Operating System(OS) is responsible for Thread Allocation and its management requesting by Java Runtime (JRE). The dynamic Garbage Collection managed by JVM is one of the critical component will impact your performance. Having a knowledge of all these components and its configuration is essential to define performance metrics. Also it will guide you to take right decisions such as defining the thread pool size, optimum level of parallelism in your code.
Code Quality as Performance Governance
The more granuler you go on performance, will give you a better control. Bring down the defined performance metrics into your core classes and functions. By doing this, everyday code integration is getting passed with your defined performance metrics and also it is one of the great mechanism to connect developers into performance engineering mindset.
We can implement this using tools like sonarQube by defining the custom rules and integrating with plugins. Also its proven that regular code refactoring to reduce the complexity and code smells too will improve the application performance.
Practice with tools
Early detection is always key in software development and we also prefer to find the issues proactively. There are plenty of tools available in the market to perform load and performance testing, choose the relevant as per your need.
Here i’m listing few for your reference.
For Java Developers, I strongly recommend Java Flight Recorder provided by Oracle. The Java Flight Recorder (JFR) gathers all the information which i described above in the Java Application stack. Most interesting thing about JFR is that it creates very low overhead on your application when you record it and this allows us to run in production environments.
Java Mission Control (JMC) is another useful tool bundled as part of JVM which helps to start JFR and also provide a GUI to perform detailed analysis of the extensive data collected by JFR.
Integrate with your culture
Performance Engineering represents a cultural shift in the way organizations view their essential processes. Moving the teams from performance testing to performance engineering isn’t an easy process and it has to be a top-down approach in an organization.
The best way to achieve this is to adapt these practices throughout your development life cycle, starting from having an integrated performance tool inside the IDE to the integration of performance tests in CI/CD pipeline.
To summarise, Performance Engineering is all about process transformation and continuous execution. These practices define a culture that enables teams to deliver fast, efficient, and responsive systems architected for large-scale populations of customers, employees, regulators, and more. A performance engineering team means that technology, business, and user representatives work together. However not every business domain demands performance as a key driver so adapt only if its required for your business.