Skip to content

Optimize Your Code

This blog is about optimizing software and application performance tuning

Archive

Category: performance improvement

Cost vs risk of leaking code

Source code leaking or hogging resources is a nightmare for any organization and developers alike. Be it an application which crashes randomly due to unusually high memory consumption or any software which hogs CPU and starves other applications to death, these are perfect recipes for disaster for any organization.

Poorly written working code can often be far worse than non-functional code as it can lead to catastrophic side effects.  It is a double-edged sword as it not only eats up system resources and hampers its performance, at the same time it adds up an entry in terms of cost for problem determination, defect resolution, research, operational and support costs.

How costly is leaking code?

continue reading…

  • Share/Bookmark

Many developers do not realize the importance of understanding how Garbage Collection works in Java. Many books state that Java performs “Automatic Garbage Collection” which is unfortunately misunderstood and taken by granted for developers.

While it’s true that Java offers a very effective garbage collection technique, it is the duty of a programmer to ensure that their code does not hog memory and is free of memory leaks.

Why is Garbage Collection needed?

In real life, when a thing outlives its utility, we treat it as garbage/ trash. JVM follows a similar principle for source code. When an object is no longer referenced, its heap space can be freed and reused by new objects.

continue reading…

  • Share/Bookmark

Keep Important Software Simple

Designing software and solving design problems can often be a complicated process. However, in most cases, the habit of over-complicating can get out of hand.

Utilizing small, distinctively singular components simply results in a more manageable and sustainable product. Using the KISS (Keep Important Software Simple or also Keep It Simple, Stupid) principle in your design as a basic methodology will ultimately result in a better piece of software.

Ideally, well designed coding will be composed of a series of small and manageable parts that address the purpose of the software. Every decision should be geared toward providing value to the end user in the most efficient manner possible. Breaking down individual problems into distinct elements makes it easier to reach this goal.

continue reading…

  • Share/Bookmark

Fifa World Cup 2010

If you are a big soccer fan like me, you would be eagerly awaiting the start of the 2010 FIFA World Cup in South Africa. As this sporting extravaganza is due to start in less than two weeks from now, I hopped on to the 2010 FIFA World Cup website to check out the match schedule.

Much to my dismay, the website is very slow and certain pages take forever to load. Just to make sure that the culprit was not my internet connection, I decided to do a YSlow test on http://www.fifa.com/worldcup/.

The YSlow analysis is inline with my original observations on the website. FIFA World Cup is amongst the most widely viewed sporting events in the world. It surely deserves a better-performance website than the current one. So, why is the current site so slow? Or why are some websites slower than others in general? This detailed report walks through the relevant aspects of website performance optimization with the 2010 FIFA World Cup website as a case study.

continue reading…

  • Share/Bookmark

Do you see the dreaded ‘OutOfMemoryError’ while running your Java application? Does it crash every now and then? Does it have memory leaks? Is your

Memory leaks

application slowing down the operating system significantly? Is your application taking forever to execute? Developers are often left pondering over these questions while writing Java applications. So, what are memory leaks? What causes them? How can you fix them in your Java applications?

In the first post of this series, we walk you through the relevant details to understand memory leaks in Java. The later posts of this series will focus on how to detect and fix memory leaks in Java applications.

What are memory leaks?

continue reading…

  • Share/Bookmark
Excessive hardware for your software problem!?

Excessive hardware for your software problem!?

The first thought that crosses the minds of many when they experience performance problems, is that their machine lacks enough power for the job at hand. While this may be true in a handful of cases, the true culprit is likely to be in the application, rather than the hardware. A common initial reaction is to blame hardware for being too weak to perform its tasks. In reality, the cause of the difficulty might easily lie in problematic software that is eating more than its fair share of the pie.

Sadly, more than a few people are sucked into the idea of piling on more muscle in the form of memory, CPU upgrades and other new hardware solutions. This can be an expensive way to treat a symptom rather than cure the disease. Some IT managers are often too quick to jump to the conclusion that the system is not working hard enough, when in reality, the applications are simply asking it to do too much.

In most instances, optimization should be considered as a first line of defense against lagging performance issues. Very often, optimizing will clean up inefficiencies such as software interfaces and codes at much lower costs than equipment replacements. A single factor like an improper pre-compiled code or a loop unrolling issue might be the root cause of the troubles. The best and usually cheapest solution is to repair the real problem rather than covering it up with a stack of new devices.

continue reading…

  • Share/Bookmark
Breaking the performance barriers.

Breaking the performance barriers.

Are you looking to optimize your software? Have you conducted a performance tuning exercise on your source code before its deployed live? These are common questions in the software development industry and it’s unfortunate that many developers and organizations treat Software Optimization and Performance Tuning as synonyms.

I’ve seen these terms being used in place of each other on several websites be it tutorials or job descriptions. The truth is that software optimization and performance tuning are not the same.

Software Optimization is a much broader term than what most people believe it to be.  Optimization encompasses a wide variety of techniques, one of which is Performance Tuning. Let’s delve deeper into these concepts to understand how they differ from each other. continue reading…

  • Share/Bookmark
Before any type of product or service can be recognized as having proper and adequate quality, specific standards must be put into place. Without these definitions of characteristic requirements, it is impossible to judge the good from the bad. Only by employing exact measurements of performance is it possible to determine whether or not maximum capability is being achieved or maintained. As software development and usage becomes increasingly important in nearly every aspect of our daily lives, the application of software metrics becomes more crucial.

Increased productivity and reliability!

Among its many benefits, software metrics could be considered to be the single most important tool in software process improvement. Metrics can indicate to what extent desired characteristic are present and which ones may be deficient. Efficiently improving factors such as reliability, volatility, errors and failure rates depends entirely on being able to measure all existing values.

continue reading…

  • Share/Bookmark

During the process of development, the option to outsource certain tasks is, at the very least, worth some serious consideration. Using an external company to aid with some of the common performance tuning tasks can not only save time and money, but could actually provide a better overall end result and improved maintainability.

Collaboration

In most cases, the decision to turn to an external source for tasks relating to code optimization, is considered to be a last resort. In fact, regularly utilizing outside resources is a strategy used by successful companies in a variety of industries. Software development is no exception when it comes to being able to benefit from supplements to in-house procedures.

continue reading…

  • Share/Bookmark

Optimize Your Code is Digg proof thanks to caching by WP Super Cache