Category Archives: fun

Java 8: Major Speed Boost by Overhauled String API

April 1st, 20141 2 Java 8 is out for a week or two now, and we all have been puzzled by the tremendous speed improvements of Oracle’s newest coup. String operations in particular have improved a lot. It’s time to look into the guts of Java and to analyze what’s going on.

Along the way, I also found out why Pattern.compile() has been deprecated in Java 8. Please stop using it. It’s a big performance penalty.

It took me a while to find out. Only when I looked into the byte code generated by Java 8, I realized what has happened. Oracle has overhauled its String implementation. Actually they have rewritten it from scratch. They need to retain the backward-compatibility, so it wasn’t that easy to see the trick: they abandoned 16-bit Unicode, replacing it by a more modern encoding. A major step to a more memory-efficient design! The Java community has been longing for this move since ages.
Continue reading

  1. Yes, this was this year’s April fool’s hoax.
  2. But read my follow-up article to learn about the real improvements of the string implementation.

GIT Explained in Really Simple Words

@tabqwerty twittered an explanation to git’s secrets that makes everything clear:

git gets easier once you get the basic idea that branches are homeomorphic endofunctors mapping submanifolds of a Hilbert space.

Funny thing is it took me a while to figure out that the sentence really is utter nonsense. I’m a mathematician, so I tried a mathematical approach to make sense of the sentence.1


Continue reading

  1. Sure you’ll have noticed by now this isn’t exactly a serious article – just the result of a lazy afternoon.