Archives for the 'Optimization' Category

Profiling WebStart Apps with JProfiler on OSX

JProfiler is a great tool for tracking down pesky memory leaks and performance problems. Here’s a trick for configuring JProfiler for use with remote Java Web Start applications on OSX.

26 June 2006 | Optimization | No Comments

Compressing Socket Data

The package includes classes for compressing and decompressing data using the ZLIB algorithms. The stream classes in the package are well-suited for accessing files and other bounded data, but do not work as well for compressing unbounded, continuous data transmitted over a socket. “Compressing data sent over a socket” describes the underlying issues and [...]

26 October 2005 | Optimization | No Comments

Batch Text Inserts with JTextPane

Part II of “Faster JTextPane Text Insertion” describes another technique for overcoming some of JTextPane‘s performance limitations when initiatializing large documents with complex styles. The ElementSpec class, defined as part of DefaultStyledDocument, provides a way to batch updates and apply them in bulk. Depending on size and complexity of the document, the speed boost can [...]

4 January 2004 | GUI, Optimization | No Comments

Why are JTextPane inserts so slow?

Inserting a large amount of styled text into a JTextPane can be painfully slow. Part I of “Faster JTextPane Text Insertion” examines two sources of sluggishness and illustrates a simple solution for one of them. (Part II will describe an additional solution.)

2 January 2004 | GUI, Optimization | No Comments

Low-Memory Deep Copies

“Faster Deep Copies of Java Objects” explains the concept of “deep copies” of Java objects and illustrates a common approach for copying objects using Java Object Serialization. “Low-Memory Deep Copy Technique for Java Objects” presents an alternate technique that trades speed for space.

22 November 2003 | Optimization | No Comments

Speeding Up Deep Copies

You can use Java Object Serialization to make deep copies of Java objects, creating distinct copies of an object and all of the objects that it references. “Faster Deep Copies of Java Objects” explains the difference between deep copies and shallow copies (as implemented by the clone method), shows a common approach to using Java [...]

8 November 2003 | Optimization | No Comments




Copyright 2003-2016 - Philip Isenhour - All code samples may be freely used under the MIT Open-Source License