"You've gotta help us out," Thomas's client pleaded, "you know, work some of your Java magic or something. We've tried everything: double the RAM, upgrade the pipe, and add in more servers. But nothing seems to help: it's still slow as molasses."

Of course, had they listened to Thomas in the first place and not had Walter, their in-house developer, architect the transaction-processing system, they wouldn't be in this mess in the first place. As tempted as he was to say "I told you so," Thomas simply agreed to come in the next day and see what he could do.

"The good news is," his client said when he arrived on-site, "Walter said that it should be pretty easy to nail down the performance bottlenecks. He said he did a lot of logging."

And as it turned out, Walter was right about one thing: there was a lot of logging. A lot. Every method in every class was logged just as follows...

/**
     * getNamePattern
     * @return namePattern
     */
  public String getNamePattern() {
        if (logger.isDebugEnabled()) {
            logger.debug("getNamePattern() - start");
        }

        if (logger.isDebugEnabled()) {
            logger.debug("getNamePattern() - end");
        }
        return namePattern;
    }

    /**
     * setNamePattern
     * @param namePattern
     */
    public void setNamePattern(String namePattern) {
        if (logger.isDebugEnabled()) {
            logger.debug("setNamePattern(String) - start");
        }

        this.namePattern = namePattern;

        if (logger.isDebugEnabled()) {
            logger.debug("setNamePattern(String) - end");
        }
    }

And as it also turned out, it was pretty easy to nail down one of the performance bottlenecks. Of course, since disabling DEBUG logging offered only a mere 40% processing time savings, Thomas had a long way to go.

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!