You are currently browsing the archives for the Performance category.

Very easy FIFO cache

2-May-2008 | Tags: , , ,
Posted in Performance, Tips | No Comments »

There are plenty of times when you need a cache for Java objects in your code. A very easy to use and simple implementation of a cache is provided with Apache ORO, wisely called CacheFIFO (http://jakarta.apache.org/oro/api/org/apache/oro/util/CacheFIFO.html).
More »

Don’t raise exceptions for every little thing

10-April-2008 | Tags: , , , ,
Posted in Performance, Tips | No Comments »

Just in case you didn’t know, raising an exception makes the JVM do a lot of dirty work breaking execution flow and stuff. More »

Keep it simple!

6-April-2008 | Tags: , , , ,
Posted in Performance, Tips | No Comments »

Do you really need to have a database table with all existing countries? What’s the benefit? Apart from adding one more database query to each page hit and an array to each users context while loading that form…

Think it over, every software component’s goal must be, first of all, to satisfy the users needs as fast and as reliably as possible. Considering the “fast” part, you must always evaluate if it’s really necessary to store this kind of info in a database table, and penalize the applications overall performance by adding another database query, recordset run through and a whole bunch of new objects in an array in request or session context.

More »