Java performance

27. December, 2010

James Sutherland: “Java performance optimization is part analysis, and part superstition and witch craft.”

In his blog post “What is faster? JVM Performance,” he compares various ways to solve problems in Java and how they perform. For example, how the various map types perform.

What surprised me as well was to poor performance of HashMap. 23% slower than Hashtable…

Another surprise that block synchronized code is twice as expensive as synchronized methods. Tools like FindBugs discourage using synchronized methods.

Or the impact of volatile on field access.


Open source drivers for Kinect

17. December, 2010

There is now an official release for Kinect drivers for Linux (Kinect is a 3D controller for the Xbox).

I wonder when we’ll see a plugin for 3D modeling in Blender. Imagine: Shoving and pulling surfaces with your bare hands, digging ditches with your fingers, punching holes with your fist.


Oracle sells OpenOffice 3.3

17. December, 2010
OpenOffice

Image via Wikipedia

Wanna buy OO? Oracle gets in line with all the rip-offs who sell you open source software and, as a special bonus, it sells you a crippled version: For home users, you get a copy that supports just one language, one OS, no SDK, no MySQL connector. Oh, there is forum based support!

In which way is that better than the download from OpenOffice.org which I get with more features and for free?

Well, there isn’t a release on the project’s official website. I guess Oracle redefined the meaning of open source software: It’s just the source, now. Use your own compiler.

LibreOffice, here I come. They also don’t have a release but at least I feel that they’re honest and show some basic respect.


Getting MercurialEclipse 1.7.0

27. November, 2010

Wondering why Eclipse suddenly asks for a password for cbes.javaforge.com? Someone decided that it was a good idea to request users of MercurialEclipse to create accounts on JavaForge.

Not impressed? Go here instead.


Firefox performance

24. November, 2010
Mozilla Firefox Icon

Image via Wikipedia

It’s 2010, Firefox is going 4.0 soon and it still has no way to tell why it’s sluggish.

Yes, it would be nice if the FF developers could make the browser so fast that it would never become sluggish in the first place. I just fear that this is simply not possible with the current design. Look at Chrome: Every tab runs in it’s own process. So what if one of them is slow? All the other still feel crisp.

On FF, if one tab takes over the machine, you’re doomed. Yes, I could disable JavaScript and every add-on individually. Why bother? Starting Chrome solves the issue in no time.

If you care, support Bug 505104: Please add a tool to gauge Addon performance.


Distributed editing

23. November, 2010

Among other things, version control systems were invented to allow several people to work on the same code. But there is another option: Distributed editing. Everyone works on the same code at the same time and all changes are sent to all involved users at the same time.

Welcome Saros – Distributed Collaborative Editing and Distributed Party Programming


No Adblock Plus button in toolbar

23. November, 2010

With the update to Firefox 4.0, the Adblock Plus button (ABP) vanished:

ABP Button missing

Where did it go?


Text editors again

23. November, 2010

Mark Pilgrim says it pretty well in WrongRoom: “you’re writing a text editor. Stop doing that. It’s 2007.”

Q: Why is there more than one text editor?

A: Because they all suck.

So after struggling with SWT’s StyledText for a while, I’m back with jEdit.

jEdit has its own flaws, though. The text renderer is … basic. No unit tests. But it seems the developers are more approachable than the Eclipse guys. So maybe it will be less effort to add the missing features.


Printing web pages

19. November, 2010

Today, I tried to create a CSS file so readers of my stories can get a nice looking printout. Or so I thought.

The cast: Opera 10, Chrome 7, Firefox 4, Konqueror.

The task: Print plain text, two column, 2.5cm left margin.

Opera

Opera has one of the best print drivers for HTML. No other browser comes even close. But no support for column-count.

Chrome 7

Webkit does support column-count but not the official CSS3 style. You need a special attribute called -webkit-column-count. Cool.

What’s way less cool is the fact that the printer driver doesn’t support it. You can see it, but you can’t get it, baby.

Firefox 4

With -moz-column-count, you get two columns which make it into the printed page … but what is that huge left margin doing there? That looks like I get only 70% of the page for my text! There are three menus where I can “Setup page” but none of the dialogs behind them allows me to modify the huge print margins! What gives?

Konqueror

You’re kidding, right?

With the Webkit module, the print output looks mostly the same as in Chrome. With the KHTML module, I can’t even get two-column text.

Conclusion

The WWW was invented 1991. That was twenty years ago. Two decades. And web browsers still can’t get something right that bored TeX in 1984.


Better code with MoDisco

18. November, 2010

I’m always thinking about better ways to create software. Create. Sculpt.

Code generation? Maybe. But I’ve left kindergarten. Creating thousands of identical sand pies doesn’t make them more tasty. Or useful.

A few days ago, I had a long talk with a guy at an Xtext presentation. Xtext can create EMF models out of computer languages. Why is that useful? Because you can get at the guts of a language.

Look here:

... some complex setup

for( Item item : list ) {
    ... do something smart with item...
}

But the guy (who wrote this code — that’s me, thank you) made a mistake: For some reasons, items with a value < 5000 should be ignored. No problem, we can simply add that. If we have the source. But imagine you had a tool to “patch” the code. Like so:

...
for( ... ) {
    if( 5000 > item.value() )
        continue;
    ...
}
...

The “…” are actual code. They mean “anything”. So this reads: “Skip code until you find a for loop and add a new condition at the front of the loop. Leave everything else intact.”

Pretty hard to do today. If we had a tool that could create an EMF model for the Java code. Enter MoDisco.

MoDisco can create a model for a software. What all those CASE tools did but the other way around. It creates a model for the software as it is now. Not very useful at first glance but think about the example above.

Or think that you’ve identifier a dangerous pattern in your code base. Now you want to fix it. MoDisco can search for these patterns for you.