efficency

JFrame that has multiple layers

Hello, I have a window that has two layers: a static background and a foreground that contains moving objects. My idea is to draw the background just once (because it's not going to change), so I make the changing panel transparent and add it on top of the static background. Here is the code for this: public static void main(String[] a...

Replace/Add several DOM Elements: Efficient and robust Method?

I am in search for an efficient method to replace a couple of DOM Elements - if possible in one action only. It is needed for augmenting TextNodes. If a certain word is present, it shall be wrapped in span-Tags, to which an event handler needs to be assigned later. so if a text Node contains the word it needs to turn from -#textNode ...

What is more expensive? Assignment or declaration?

Hey Guys, Just a quick question what would be more expensive in Java? double test = 5; double test1 = 5; or double test = 5; double test1 = test; ...

Generate JSON - how to improve performance

Here is what I am doing currently. Get data from database in DataTable (max records would be 100 but stored proc will search against more than 500,000 records. I already took care of search optimization in database. I am looking how I can improve the performance as much as I can in step# 2 and step# 3 below.) Create a generic list (Li...