Oops, I did it again….

Compressed oops in the Hotspot JVM Big Question is why to bother? And the answer is Cache. In other words, using shorter pointers allows fitting more data into processor caches, which improves performance considerably. References: 32-bit or 64-bit JVM? How about a Hybrid? <a href=”http://blog.juma.me.uk/2009/04/03/load-unsigned-and-better-compressed-oops/”>Load unsigned and better Compressed Oops

Read more

Reducing memory usage

Example 31-2. Setting fetch size to turn cursors on and off. PostgreSql, JDBC and large result sets Large ResultSet on postgresql query Is JDBC a big memory hog? Setting some reasonable fetch size might be meaningfull when working with results sets consisting from thousands of elements. Appearent difference is that with default fetch size, all…

Read more

Compact String Dictionary

If system needs to process lots of short strings, which actually quite often are same, then using some dictionary to map strings into compact unique identifiers can improve memory usage and performance quite a bit. [code lang=”java”] package org.kari.test.string; import gnu.trove.TObjectIntHashMap; import java.util.ArrayList; import java.util.List; /** * Dictionary mapping strings int compact identifiers * *…

Read more

Going to DB…

Open Source Database Engines in Java Hmm…. H2? When developing software with Java, why anyone would bother with non-Java DB, i.e. all the problems with native library compatibility and such (32bit/64bit, Linux/Windows/etc., M$XP/M$Vista/M$7/…)? Especially interesting sounds the possibility to embed DB into java process, thus avoiding having separate process and socket (or such) communication with…

Read more

Comments…

every line of code should be commented Easy. 10 lines, no comments. After writing a couple of million lines of code, the more code I write, the more I unwind it. Somewhere along the line, adolescent programmers got the idea that jamming all your logic into as few unreadable lines as possible is the fastest…

Read more