Continuous Performance: A Best Practice to Ensure Faster Code

Continuous Performance: A Best Practice to Ensure Faster Code

ontinuous integration is the practice of conducting code builds at least once a day to catch small integration problems before they grow into show stoppers. The more often programmers test a fully integrated system, the more opportunities they have to check the functional integrity of their applications?which leads to better products. Development teams all over the world are adopting this best practice.

Continuous integration also has a hidden benefit: it sets teams up to find and fix performance problems. The trouble with performance is nobody cares about it until there’s a problem, and by the time a performance issue makes its presence known it’s often very difficult to find and fix. Programming teams who practice continuous integration have the advantage of being able to test performance on a regular and automated basis.

Consider the seven key steps in the typical development process:

  1. Planning
  2. Coding
  3. Compiling
  4. Unit testing
  5. Acceptance testing
  6. System testing
  7. Performance testing

Long-running queries, unnecessary executions, excessive results sets, and other performance issues usually don’t surface until the acceptance testing phase?the fifth stage of development?or later. Making matters worse, teams usually don’t see those problems as a priority and don’t deal with them until much later, when the application moves out of QA with a punch list of lag times that must be corrected. As a result, programmers can spend weeks finding and fixing performance problems, sometimes spending as much as 20 percent of the development process in an abysmal bug hunt (based on statistical feedback from a survey of the IronGrid user base). Sluggish performance can also lead to design changes, an increasingly difficult prospect as the investment in code grows. Quite often all this leads to late delivery or, if that’s not an option, shipping poorly performing code.

Continuous performance can be just as beneficial as performing unit tests with every build.
To address performance problems earlier in the development process, teams can implement a new practice called continuous performance, which borrows from the continuous integration concept to establish a specific and timesaving process for detecting and fixing performance problems.

For developers who practice continuous integration, some of the fundamental aspects of continuous performance will sound familiar:

  • Test performance at least nightly, just as unit tests confirm functionality. This “seize the build” approach ensures that programmers have frequent opportunities to check performance as the application grows.
  • Reduce the amount of code that requires testing and tuning, which cuts down performance-tuning time. As with unit tests, performance tests are easier to apply to smaller bits of code. Testing with every build therefore makes sense both for functionality and for performance. Continuous performance, like other forms of automated testing, drives code that’s cleanly factored and easier to read and maintain.
  • Minimize variances in performance specifications. The more closely an application adheres to performance specs as lines of code mount, the easier it is to manage performance throughout the development process.
  • Improve performance of the final product. Performance degradation worsens over time, so keeping performance in check with every build results in faster code on the back end.
  • Sustain competitiveness with better-performing applications. The output of every development team, whether an in-house app or a major commercial software release, directly impacts the relative success of their organization.
  • Get more efficient. Continuous performance lets you capture requirements in automated test cases. Instead of writing extra code that might improve performance, programmers can focus on performance only when it’s needed and where it’s most appropriate.

Any process change sounds like a lot of work at first, but here’s the good news: implementing continuous performance doesn’t have to be painful, and it can be just as beneficial as performing unit tests with every build.

Establishing a Process
For a continuous performance strategy to take hold, performance must be a priority from the earliest stages of the project. It can’t be left until acceptance testing or later. True, some problems don’t manifest themselves until they’re in an integrated environment, such as when a database application finally is tested with a genuine, live load or when an application makes its first calls to a mainframe. So while you can’t catch every performance error, you can?and should?catch some early.

Development teams who already conduct daily builds and unit tests can easily enhance their environments with continuous performance techniques. The following seven steps provide a roadmap to help developers ferret out the necessary time from their existing programming environments, while leveraging their already proven discipline by taking advantage of existing continuous integration efforts.

Step One: Include performance in the requirements definition.
If performance is addressed up front, extending the scope of the project to include specific parameters or overall goals is easy. Also, the earlier a problem takes root in a process, the more costly and difficult it is to mitigate it down the road.

If performance is addressed up front, extending the scope of the project to include specific parameters or overall goals is easy.
Naturally, applying a tremendous level of granularity to those metrics may not be realistic early on, but some overall performance specs for the application (such as 1.5 seconds to generate a Web page that makes three calls to a SQL database) are useful in setting the bar for more specific goals that can be established as the application takes shape. (Product managers should work in tandem with the development team during this step to set realistic and meaningful performance specs.)

Step Two: Work performance testing into the development timeline.
Product development and delivery schedules are based on competitive issues, the scope of the feature set, and the resources applied to product development. These factors determine the timeline over all else, so development schedules are often unrealistic. By scheduling performance tests throughout development (and ideally with every build), teams can actually buy more time because they are spared long and arduous tuning sessions at the project’s end. The less time is required to address bottlenecks at the end of the process, the less pressure developers feel to maintain a breakneck coding pace.

Step Three: Conduct performance tests on a regular basis?at least nightly.
A functional integrity test is a golden opportunity to also test performance, which can be a seamless addition to your continuous build process. It’s important to define a quantifiable standard for performance, to establish a pass/fail point. This makes it easier to keep coding until the software passes, just as many programmers write to pass unit tests.

Step Four: Constantly monitor performance activity.
Performance monitoring involves a series of tests, some of which may be conducted nightly. Others, however, might occur only when you have enough code to see how different units interact with one another. Examples include monitoring CPU consumption, stack trace, call history, identifying how many times a function is called and by what other function, memory profiling, track threads, identifying thread contentions or starvation, identifying EJB execution time and spotting long-running EJBs. Plenty of tools are available to measure these things, but developers need to make a record of their findings to create a baseline of code performance (see Step Five).

Step Five: Track the performance history as the application grows.
Establishing a performance history for every application is crucial for a truly effective continuous performance environment. By tracking how the code performs, you can establish a performance baseline, or signature, for your application. This signature allows you to see exactly what happened when new code was introduced to different parts of the application. For instance, two units might perform fine separately. But when you integrate them, you may notice a significant bottleneck. Knowing the history of each unit will help you identify the root cause of that problem, so you can fix it before it is compounded with the next build or integration.

Step Six: Use that data to get a fix on the code responsible for bottlenecks.
By comparing the previous images of your application and noting performance degradations or even improvements, you can then identify which code is causing that result. The history becomes invaluable here, because programmers will forget when they introduced which pieces of code. The best approach is to leverage tracking tools that can record test results, even though the market is woefully underserved here. Most tools limit their use to code versioning and test case monitoring.

Step Seven: Use your knowledge to efficiently tune only the code that caused the performance problem.
This is the step where the continuous performance strategy pays off generously. For the first time, developers will have a way to pinpoint exactly where they introduced performance-sapping code. They can then fix the problem before it is buried beneath dozens of new builds. Because intuition, even in the best of developers, is a poor way to identify problem sources, each programmer can significantly reduce total effort by optimizing only broken code.

These seven steps provide developers with a process that allows them to create an ongoing history of the performance of their applications?a performance signature that can be referred to any time a bottleneck that must be tuned emerges. In the end, the weeks of tuning before the product ships can be dramatically reduced or even eliminated. And no longer will software companies and development teams wait until the final stages of development?or even later?to address performance problems.

Tools: The Final Step
Acquiring tools and technologies usually is easier than changing the way we work. Yet while nearly any development team can establish a continuous performance environment without organizational changes or major procedural upheavals, few know where to find tools that can help them set a performance baseline and test against it.

Some open source tools have made initial progress. For example, JUnitPerf is a simple extension of JUnit that lets every programmer time-box a given JUnit test case, or even test it under load. It does require some extra effort to set up and tear down test cases, and its load testing is relatively simplistic. But it’s a good start.

Nearly any development team can establish a continuous performance environment without organizational changes or major procedural upheavals.

In addition to open source software, a new generation of commercial tools is emerging. Some companies like Borland are moving their performance suites into the areas of acceptance testing with some level of automation. Most larger companies, though, focus on lucrative development environments and post-production tools. For the most part, continuous performance is the domain of small companies whose software is solely devoted to enabling these strategies.

The Benefits of Continuous Performance
More and more, companies large and small are recognizing the need for ongoing performance testing, and they are working to introduce products to meet that need. Those that are bound to succeed will address all the key aspects of continuous performance implementation, including the ability to monitor and track performance over time. Meanwhile, server-based solutions that allow entire development groups to automate their unit tests will also be crucial for full-fledged solutions.

With the right guidelines and effective tools, continuous performance devotees will benefit from much more than simply saving a couple of weeks of code tuning. Development teams will preserve product schedules, avoid needless debugging after an application has been deployed, deliver better quality code to internal users and external customers, create happier and more productive programming teams, streamline post-development steps including QA and beta programs, and reduce the costs of supporting products.

These benefits should make the easy transition to a continuous performance environment an even easier sell to management. The financial costs are minimal, while the potential benefits can shoot straight to the bottom line.

devx-admin

devx-admin

Share the Post:
Poland Energy Future

Westinghouse Builds Polish Power Plant

Westinghouse Electric Company and Bechtel have come together to establish a formal partnership in order to design and construct Poland’s inaugural nuclear power plant at

EV Labor Market

EV Industry Hurting For Skilled Labor

The United Auto Workers strike has highlighted the anticipated change towards a future dominated by electric vehicles (EVs), a shift which numerous people think will

Soaring EV Quotas

Soaring EV Quotas Spark Battle Against Time

Automakers are still expected to meet stringent electric vehicle (EV) sales quotas, despite the delayed ban on new petrol and diesel cars. Starting January 2023,

Affordable Electric Revolution

Tesla Rivals Make Bold Moves

Tesla, a name synonymous with EVs, has consistently been at the forefront of the automotive industry’s electric revolution. The products that Elon Musk has developed

Poland Energy Future

Westinghouse Builds Polish Power Plant

Westinghouse Electric Company and Bechtel have come together to establish a formal partnership in order to design and construct Poland’s inaugural nuclear power plant at the Lubiatowo-Kopalino site in Pomerania.

EV Labor Market

EV Industry Hurting For Skilled Labor

The United Auto Workers strike has highlighted the anticipated change towards a future dominated by electric vehicles (EVs), a shift which numerous people think will result in job losses. However,

Soaring EV Quotas

Soaring EV Quotas Spark Battle Against Time

Automakers are still expected to meet stringent electric vehicle (EV) sales quotas, despite the delayed ban on new petrol and diesel cars. Starting January 2023, more than one-fifth of automobiles

Affordable Electric Revolution

Tesla Rivals Make Bold Moves

Tesla, a name synonymous with EVs, has consistently been at the forefront of the automotive industry’s electric revolution. The products that Elon Musk has developed are at the forefront because

Sunsets' Technique

Inside the Climate Battle: Make Sunsets’ Technique

On February 12, 2023, Luke Iseman and Andrew Song from the solar geoengineering firm Make Sunsets showcased their technique for injecting sulfur dioxide (SO₂) into the stratosphere as a means

AI Adherence Prediction

AI Algorithm Predicts Treatment Adherence

Swoop, a prominent consumer health data company, has unveiled a cutting-edge algorithm capable of predicting adherence to treatment in people with Multiple Sclerosis (MS) and other health conditions. Utilizing artificial

Personalized UX

Here’s Why You Need to Use JavaScript and Cookies

In today’s increasingly digital world, websites often rely on JavaScript and cookies to provide users with a more seamless and personalized browsing experience. These key components allow websites to display

Geoengineering Methods

Scientists Dimming the Sun: It’s a Good Thing

Scientists at the University of Bern have been exploring geoengineering methods that could potentially slow down the melting of the West Antarctic ice sheet by reducing sunlight exposure. Among these

why startups succeed

The Top Reasons Why Startups Succeed

Everyone hears the stories. Apple was started in a garage. Musk slept in a rented office space while he was creating PayPal with his brother. Facebook was coded by a

Bold Evolution

Intel’s Bold Comeback

Intel, a leading figure in the semiconductor industry, has underperformed in the stock market over the past five years, with shares dropping by 4% as opposed to the 176% return

Semiconductor market

Semiconductor Slump: Rebound on the Horizon

In recent years, the semiconductor sector has faced a slump due to decreasing PC and smartphone sales, especially in 2022 and 2023. Nonetheless, as 2024 approaches, the industry seems to

Elevated Content Deals

Elevate Your Content Creation with Amazing Deals

The latest Tech Deals cater to creators of different levels and budgets, featuring a variety of computer accessories and tools designed specifically for content creation. Enhance your technological setup with

Learn Web Security

An Easy Way to Learn Web Security

The Web Security Academy has recently introduced new educational courses designed to offer a comprehensible and straightforward journey through the intricate realm of web security. These carefully designed learning courses

Military Drones Revolution

Military Drones: New Mobile Command Centers

The Air Force Special Operations Command (AFSOC) is currently working on a pioneering project that aims to transform MQ-9 Reaper drones into mobile command centers to better manage smaller unmanned

Tech Partnership

US and Vietnam: The Next Tech Leaders?

The US and Vietnam have entered into a series of multi-billion-dollar business deals, marking a significant leap forward in their cooperation in vital sectors like artificial intelligence (AI), semiconductors, and

Huge Savings

Score Massive Savings on Portable Gaming

This week in tech bargains, a well-known firm has considerably reduced the price of its portable gaming device, cutting costs by as much as 20 percent, which matches the lowest

Cloudfare Protection

Unbreakable: Cloudflare One Data Protection Suite

Recently, Cloudflare introduced its One Data Protection Suite, an extensive collection of sophisticated security tools designed to protect data in various environments, including web, private, and SaaS applications. The suite

Drone Revolution

Cool Drone Tech Unveiled at London Event

At the DSEI defense event in London, Israeli defense firms exhibited cutting-edge drone technology featuring vertical-takeoff-and-landing (VTOL) abilities while launching two innovative systems that have already been acquired by clients.

2D Semiconductor Revolution

Disrupting Electronics with 2D Semiconductors

The rapid development in electronic devices has created an increasing demand for advanced semiconductors. While silicon has traditionally been the go-to material for such applications, it suffers from certain limitations.

Cisco Growth

Cisco Cuts Jobs To Optimize Growth

Tech giant Cisco Systems Inc. recently unveiled plans to reduce its workforce in two Californian cities, with the goal of optimizing the company’s cost structure. The company has decided to

FAA Authorization

FAA Approves Drone Deliveries

In a significant development for the US drone industry, drone delivery company Zipline has gained Federal Aviation Administration (FAA) authorization, permitting them to operate drones beyond the visual line of

Mortgage Rate Challenges

Prop-Tech Firms Face Mortgage Rate Challenges

The surge in mortgage rates and a subsequent decrease in home buying have presented challenges for prop-tech firms like Divvy Homes, a rent-to-own start-up company. With a previous valuation of

Lighthouse Updates

Microsoft 365 Lighthouse: Powerful Updates

Microsoft has introduced a new update to Microsoft 365 Lighthouse, which includes support for alerts and notifications. This update is designed to give Managed Service Providers (MSPs) increased control and

Website Lock

Mysterious Website Blockage Sparks Concern

Recently, visitors of a well-known resource website encountered a message blocking their access, resulting in disappointment and frustration among its users. While the reason for this limitation remains uncertain, specialists