Performance Tuning

Software optimization is a broad term, encompassing a variety of methods and technologies. Not all of these methods provide real benefits to a given product and their implementation is usually a time-consuming process, therefore it is important to identify the relevant ones and prioritize their application. Understanding the causes for performance issues on existing code bases can be difficult, because many factors need to be taken into account. Eliminating the problems is equally challenging, as it requires in-depth knowledge of several advanced topics in software development, from algorithms to low-level machine architecture considerations. Griffin Software has the experience and know-how needed to analyze and improve the performance of projects of any scale.

Localized versus systemic problems

When a program spends a significant amount of its execution time in a relatively small portion of code, that portion is called a profile spike. Due to the focused nature of these scenarios, they are usually easy to identify and fix, so they are not worth the effort and costs of hiring an external contractor. After all the spikes are removed, the program is said to be left with a flat profile, meaning that the execution time is evenly spread between all parts of the code. The real problems begin when a product with a flat profile has unsatisfactory performance, because cheap, localized changes will only bring negligible improvements.

These cases are further complicated by the lack of tools and objective measures which could point toward a solution. Example problem causes include useless memory copying due to a badly designed subsystem, or certain algorithms or library usage patterns which are frequently repeated in different parts of the code. Individual invocations of the inefficient algorithm or the redundant memory copy will not consume much time, so normally they won't be targeted for optimization. A large project will obscure the repetition, especially since there will be some variation between instances, so a superficial analysis will miss important improvement opportunities. We have the expertise required to perform a thorough investigation and find this kind of hidden flaws, and you may find it more effective to hire us than to redirect in-house resources from feature development to optimization.

From algorithms to implementation

Sometimes even isolated profile spikes are hard to improve. If the purpose of a program is to perform a certain expensive computation, it is normal, and even desired, to see a profile spike for the part of the code which implements that computation, when compared to secondary functionality like handling the user interface. In many cases the execution speed can be increased despite the fact that the code "looks" polished enough. Maybe an auxiliary algorithm can be replaced with a more scalable alternative, or maybe the data can be prepared somehow so that the processing works faster. Maybe some computations can be factored in a different way to reduce some repeated operations. More often, taking into account the particularities of the hardware, e.g. cache memory coherency, dependency chains, out of order execution or vector processing capabilities, can yield impressive speed gains. High-level algorithm tuning and low-level machine optimization are very different fields, and they are equally hard to master. We offer both.

Emerging technologies

The desktop and server hardware markets have recently seen a drastic shift toward multicore processing, and other platforms have followed suit. The speed of individual processor cores will continue to improve, but not at the same explosive rate as before. The traditional "single-processor" optimizations mentioned in the previous paragraph will always be important, but there is also a lot of untapped potential in running code on multiple processors at the same time. Quad-core machines will soon become commonplace, but software designed for a single processor will only use 25% of their computing power, and the situation is only going to get worse as time passes. A technology with a similar concept, but different implementation is GPGPU, which consists in using the 3D graphics chip found in the video card (called a GPU) for more general purpose tasks (hence the prefix GP).

Adapting an existing product to use these technologies is not trivial in most cases. Even designing a project from the ground up specifically for this emerging paradigm can be challenging, since a host of new concepts, algorithms and pitfalls must be considered. We can help you analyze and implement multicore and GPGPU code for your applications.

Maintainability versus performance

There is a widespread myth that optimized code is less readable and/or reliable than "normal" code, so you might arrive at the conclusion that a 10% performance penalty is preferable to having unmaintainable code. Proper optimizations are not allowed to affect the stability or functionality of the program. Optimization has nothing to do with obfuscation either, so there's no reason why optimizing a piece of code will make it less readable. In some cases, the optimized code even ends up being simpler than the original. When simple but inefficient algorithms are replaced with more sophisticated ones, the code can become harder to understand, but this is not a problem with performance tuning in particular, and it can be addressed with well known tools: training and code documentation. As for that 10% which is considered acceptable, it is a number pulled out of thin air. A lot of experience is required to provide a good estimate of the actual impact of "simple" code on a large project, and a saying is not something to rely on in this case.

Protecting your intellectual property

Hiring our services involves giving Griffin employees access to parts of your source code, which will raise concerns about the safety of your intellectual property. All such access will be subject to a non-disclosure agreement and your code will not be stored after we complete our work. Other conditions, like on-site work or special guarantees, can be discussed individually for each contract.

Interested?

If you have further questions about our services, or would like to set up a meeting or conference call to discuss cooperation opportunities, you can reach us in the following ways:

  • E-mail: contact
  • Phone: +4 031 104 08 21
    (GMT+2 time zone)

You can also visit the company page for additional details about Griffin Software.