Logging

Interesting: High Performance And Smarter Logging References: Log4J Logback – successor of Log4J

Read more

MTBF it’s not your friend

MTBF hit my OS system disc yesterday. Luckily only few sectors were broken, but harddrive is definitely kaput. Thus reinstalling OS in another disc. Luckily all configs from old system were still available.

Read more

SSL with server socket

Netty Need to investigate this a bit further, based into FAQ, it may have some support for SSL with server socket. Btw, one really irritating fact of standard SSLServerSocket implementation of java is that API launches new handler thread everytime when new SSL socket is created. It’s pretty clear that when having server with thousands…

Read more

Speculate, but don’t guess, measure to see

How synchronized keyword behaves in methods. I’ve heard speculation that doFoo1() would result into more compact byte code, but I don’t buy that. Assumption: Byte code in both cases, is same. So we have this sample, [code lang=”java”] class SyncMe { synchronized void doFoo1() { int x = 0; } void doFoo2() { synchronized (this)…

Read more

Eeny, weeny, nitpicking, peeny

Todays lesson is: What javac does with following methods, when compiled. Assumptions: Iterating over ArrayList vs. List generates optimized code, not creating Iterator (i.e. would optimize memory usage using RandomAccessList API), but using int index Itearating over Object[] is faster than List/ArrayList foreach loop for Object[] is as tight code as manual iteration [code lang=”java”]…

Read more

Time to prepare for Java 7

It’s time to prepare for compatibility with Java 7. Release date is supposed to be around 28.7.2011, so there is’ still roughly 2 months to prepare for compatibility.

Read more

interesting

Howly cow, or whatever. It’s hard to impress to impress me, but this framework raised my interest. Vaadin I will be pushing to use this framework, since it has clear advantages over some plain GWT approaches. Need to build some more prototypes for testing framework.

Read more

Optimized Strings – Who knows, possibly

JVM seems to include few new intesting optimization options -XX:+UseCompressedStrings -XX:+OptimizeStringConcat -XX:+UseStringCache Why these sounds interesting. Well, simply because strings are among the biggest memory consumers, and string manipulations like concat tends to be relatively slow. Update: OptimizeStringConcat is in JDK 1.6.0_18 References: The Virtual Machinist: -XX:+UseCompressedStrings explained Google Groups: Description of -XX:+OptimizeStringConcat ? Stackoverflow:…

Read more

Premature Optimization: Chapter ”Class is the root of all evil”

It’s interesting question of how different constructs perform in code. And in java world and very often encountered construct is discussion about what should be used as param (or return value) in API methods. From API maintainability, extensibility, clearness etc. point of view, answer is 101% clear. Using interfaces make APIs more generic, by leaving…

Read more

Analyzing thread time usage

Without any testing, just seeing that it compiles, following code snippet should allow embedding periodic thread time usage analysis into application. [code lang=”java”] import java.util.HashMap; import java.util.IdentityHashMap; import java.util.Iterator; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; /** * Thread time usage analyzer */ final class Analyzer extends Thread { /** * Accuraracy of measurement; coarse timing is enough,…

Read more