Skip to content
Advertisement

Tag: performance

java.util.Map values() method performance

I have a map like this with several million entries: I need to get list of values, which could be done by calling java.util.Map values() method. Is Collection of values created every time I call values() method or is it pre-computed from performance perspective? As my Map has several millions elements, I do not want to create new list object

Performance of JavaFx Gui vs Swing

I wrote two simple programs, both draw the same Sierpinski Triangle: One program was implemented using swing, and one using javafx. There is a very significant performance difference, swing implementation being consistently much faster: (In this test case : Swing over 1 sec. Javafx over 12 seconds) Is it to be expected or is there something very wrong with my

Android – Prevent white screen at startup

As we all know, many Android apps display a white screen very briefly before their first Activity comes into focus. This problem is observed in the following cases: Android apps that extend the global Application class and perform major initializations therein. The Application object is always created before the first Activity (a fact that can be observed in the debugger),

Java infinite loop performance

I have a Thread that only has to work when a certain circumstance comes in. Otherwise it just iterates over an empty infinite loop: Does it affect the performance when the loop actually does nothing but it has to check if it has to do the calculation every iteration? Only creating a this Thread when needed is not an option

Increase the java heap space of a certain app

I have an application that I want to run it and gives it more heap memory. I run my application using this command in terminal: home/bin/hadoop jar $pathofjarfile parameter1 parameter2 but I don’t know how to allocate more heap memory when running this application? if anyone could please advise. Answer The easiest method to increase the heap space is using

String vs StringBuffer. Tip of IDEA

Intellij Idea offers to replace the following: To: As far as I know it’s less effective (mutable/immutable). So, what’s better? Answer The second one compiles to the same byte-code as the first one, except it uses a non-synchronized StringBuilder instead of a synchronized StringBuffer. So it’s not only much more readable, but also slightly faster. I’d choose the second one.

Advertisement