News for hackers. Stuff that matters.
Re:Apple deprecates Java by rimantas on Thursday October 21, 2010 @05:58AM (#1814849)
I use SmartSVN, wouldn't call it ugly.
Re:Apple deprecates Java by albertzeyer on Thursday October 21, 2010 @07:00AM (#1814952)
But this seems to be AWT. And the GUI just doesn't feel as snappy as native Cocoa.

Actually, I wonder why that is. I always thought that it is Java itself which makes Java applications feel slow. But I haven't noticed this in Cyberduck. So maybe it is just AWT.

I wonder why that might be. Maybe because AWT does all the drawing itself, which is much slower compared to the native toolkit?

Re:Apple deprecates Java by riffraff on Thursday October 21, 2010 @08:39AM (#1815150)
many SWT apps, using native look and feel, still feel slowish (think azureus/vuze if not eclipse). Some AWT apps are perfectly snappy e.g. jedit opens a file faster than macvim on my box.

My belief is that apart form some overhead in AWT against native toolkit, 90% of the laggish experience in java apps is due to poor coding.

In turn, this is probably a byproduct of the java platform/language (abuse threads cause they are easier than an event loop, abuse locking cause synchronized is more obvious than util.concurrent, avoid thinking of memory management cause you have a GC, do not pay attention to proper data structures cause you can get away with builtin collections etc)

Re:Apple deprecates Java by stcredzero on Thursday October 21, 2010 @08:59AM (#1815184)
do not pay attention to proper data structures cause you can get away with builtin collections etc

Specific examples from your experience?

Re:Apple deprecates Java by riffraff on Thursday October 21, 2010 @10:54AM (#1815649)
code I wrote myself :)

First one I think of (cause I redid it today, in ruby :) is:

you need to keep a list of lines you already processed in a large log analysis. I'd just use a Set (which is a hash underneath) and get done, although I'd have saved a bunch of overhead (memory allocations, gc pressure) using a bloom filter.

Re:Apple deprecates Java by stcredzero on Thursday October 21, 2010 @12:30PM (#1816168)
Examples where the "extra overhead" caused an actual problem?
Re:Apple deprecates Java by riffraff on Thursday October 21, 2010 @05:26PM (#1817506)
A a few more gigabytes of memory allocated, consequent swapping and slow processing
Re:Apple deprecates Java by riffraff on Thursday October 21, 2010 @12:44PM (#1816275)
the one I just wrote you about
Re:Apple deprecates Java by stcredzero on Thursday October 21, 2010 @12:48PM (#1816297)
What problem did that specific bit of GC pressure cause you? (I'm doing "5 whys" in reverse. Otherwise known as "The Socratic Method.")
Re:Apple deprecates Java by riffraff on Friday October 22, 2010 @04:55AM (#1819024)
sorry I thought I replied yesterday but apparently my comment got lost.

Using a (hash)set instead of a bloom filter caused memory usage to explode, which in turn led to memory thrashing/swapping which in turn led to slow processing times.

The rest of the code runs in constant time (well, linear in the size of the item, with num(items) >> size(items[n]) ) and it did work fine for smaller inputs.

Re:Apple deprecates Java by stcredzero on Friday October 22, 2010 @06:32AM (#1819167)
How much slower? Just how much wall clock time did you lose?
Re:Apple deprecates Java by riffraff on Friday October 22, 2010 @06:49AM (#1819198)
hard to estimate I'm sorry. The first naive implementation had been running for more than 15 minutes before I thought it as too much and killed it. Rewrote version run all in about 5.