Tag Archives: performance

3 reasons that XML should be Streamed and never “Stringed”

XML is a text format, and so it is tempting to handle it with the normal String handling capabilities of Java, but there are several reasons that you must never do this.  XML should either be on the disk as a sequence of bytes, or it should be parsed as a DOM tree of decoded string values, but it should never be in a String in its encoded value. Read the rest of this entry »

Leave a comment

Posted by on July 17, 2013 in Coding, Design


Tags: , , , ,

#31 Factor Expensive Expressions out of Loops

If you are are calling a method on an object, it is not always clear whether it is an expensive operation (takes a long time, lots of CPU power) or an inexpensive operation.  If you have a loop, and you are calling the same method with the same parameters multiple times, you run the risk of making a very expensive mistake. Read the rest of this entry »

Leave a comment

Posted by on October 14, 2012 in Coding


Tags: , ,

#24 Sprinkling “trim” through the code

One bad practice I have seen on many occasions is the use of trim() statements throughout the code.  This is a poor coding practice, and it is an indicator of disorganized code. Read the rest of this entry »

Leave a comment

Posted by on November 19, 2011 in Coding


Tags: , , ,