From: Rob Landley <landley@webofficenow.com>
To: "J . A . Magallon" <jamagallon@able.es>, landley@webofficenow.com
Cc: Aaron Lehmann <aaronl@vitelus.com>,
hps@intermeta.de, linux-kernel@vger.kernel.org
Subject: Re: [OT] Threads, inelegance, and Java
Date: Wed, 20 Jun 2001 15:15:53 -0400 [thread overview]
Message-ID: <0106201515530C.00776@localhost.localdomain> (raw)
In-Reply-To: <20010620042544.E24183@vitelus.com> <01062007252301.00776@localhost.localdomain> <20010621000725.A24672@werewolf.able.es>
In-Reply-To: <20010621000725.A24672@werewolf.able.es>
On Wednesday 20 June 2001 18:07, J . A . Magallon wrote:
> On 20010620 Rob Landley wrote:
> What do you worry about caches if every bytecode turns into a jump and more
> code ?
'cause the jump may be overlappable with extra execution cores in RISC and
VLIW?
I must admit, I've never actually seen somebody try to assembly-level
optimize a non-JIT java VM before. JIT always struck me as a bit of a
kludge...
> And that native code is not in a one-to-one basis with respect to
> bytecode, but many real machine code instructions to exec a bytecode op ?
Sure. But if they're honestly doing real work, that's ok then. (If they're
setting up and tearing down unnecessary state, that's bad. I must admit the
friction between register and stack based programming models was pretty bad
in the stuff I saw back around JavaOS, which was long enough ago I can't say
I remember the details as clearly as I'd like...)
Then again JavaOS was an abortion on top of Slowaris. Why they didn't just
make a DPMI DOS port with an SVGA AWT and say "hey, we're done, and it boots
off a single floppy", I'll never know. I mean, they were using green threads
and a single task for all threads ANYWAY... (Actually, I know exactly why.
Sun thinks in terms of Solaris, even when it's totally the wrong tool for the
job. Sigh...)
Porting half of Solaris to Power PC for JavaOS has got to be one of the most
peverse things I've seen in my professional career.
> I have seen school projects with interfaces done in java (to be 'portable')
> and you could go to have a coffee while a menu pulled down.
Yeah, but the slowness there comes from the phrase "school project" and not
the phrase "done in java". I've seen menuing interfaces on a 1 mhz commodore
64 that refreshed faster than the screen retrace, and I've WRITTEN java
programs that calculated animated mathematical function plots point by point
in realtime on a 486.
> Would you implement a search funtion into a BIG BIG database in java ?
You mean spitting out an SQL request that goes to a backend RDMS? I've done
it. (Via MQSeries to DB2.)
Interestingly, a rather large chunk of DB2 itself seems to be implemented in
Java Dunno how much, though. Probably not the most performance critical
sections. But it uses a heck of a lot of it...
> No, you give a java interface to C or C++ code.
A large part of this is "not reinventing the wheel".
Also, I'd like to point out that neither Java 1.0 nor Java 1.1 had an API to
truncate an existing file. (I pointed that out to Mark English at Sun back
when I worked at IBM, and apparently nobody'd ever noticed it before me.
Fixed in 1.2, I'm told.)
> Until java can be efficiently compiled, it is no more than a toy.
I haven't played with Jikes.
> Then why do you use Java ? If you just write few objects with many methods
> you are writing VisualBasic.
That was below the belt. I'm trying to figure out if you've just violated a
corolary of Godwin's law with regards to language discussions, but I'll let
it pass and answer seriously.
Because used that way, Java doesn't suck nearly as badly as visual basic
does? (My cumulative life experience trying to program in visual basic adds
up to about three hours, so I don't consider myself an authority on it. But
I've had enough exposure to say it sucks based on actually trying to use it.)
That and it was developed on OS/2 to be deployed on (at least) windows 95,
98, and power macintosh?
I still had threading inherent in the language. The graphics() class is
actually a fairly nice API for doing simple 2d line drawing stuff in a
portable way. (It is too, except for fonts. If you don't use any
heavyweight AWT objects, and you're religious about using fontmetrics to
measure your text, you can actually get pretty portable displays.) I still
had the GOOD bits of C++ syntax without having to worry about conflicting
virtual base classes. It's TRULY object oriented, with metaclasses and
everything.
> See above. Traversing a list of objects to draw is not time consuming,
> implementing a zbuffer or texturing is. Try to implement a zbuffer in java.
I'll top that, I tried to implement "deflate" in java 1.0. (I was porting
info-zip to java when java 1.1 came out.
Yeah, the performance sucked. But the performance of IBM's OS/2 java 1.0 jdk
sucked compared to anything anybody's using today (even without JIT).
> The problem with java is that people tries to use it as a general purpose
> programming language, and it is not efficient. It can be used to organize
> your program and to interface to low-level libraries written in C. But
> do not try to implement any fast path in java.
I once wrote an equation parser that took strings, substituted values for
variables via string search and replace, and performed the calculation the
string described. It did this for every x pixel in a 300 pixel or so range
to get the resulting y value, then iterated through the array thus created
and played connect the dots to graph the function. On a 486 it could update
the display about four times a second as different values were plugged in.
That may not have been nearly as fast as it would have been in C, but it was
fast enough for me. (And most of that was the darn string creation to
substitue in the values, but I never got around to doing a more efficient
variable lookup table method because I didn't have to, the performance was
good enough.)
> If java or pyton were so efficient, you could write a ray-tracer or a
> database search engine in java or python, etc. Look, write it in java, not
> use a java interface to a binary module.
And it'd be even faster if you wrote it in hand optimized assembly. Your
point being?.
Somebody wrote a distributed.net key cracker in Java, which is about 5% as
efficient as the hand-optimized assembly native code key crackers people
usualy used. Benchmarking one of those on a pentium desktop, it still beat
my little 486 laptop using the native thing, which had been the height of
technology about six years earlier. And I can leave the java key cracker
running for an hour or two in a web browser at the local library without
anyone getting too upset. I can't do that with a native one. (What they
object to is installing software, you see. Not running it.)
I'm upset that Red Hat 7.1 won't install on that old laptop because it only
has 24 megs of ram and RedHat won't install in that. I haven't heard anybody
else complain about that. (Their questionable compiler descisions, sure.
The security, of course. The fact they will no longer install in 16 megs of
ram, no.)
There's a gameboy emulator written in java out on the net somewhere that
plays gameboy games in a web page as fast as the original gameboys used to.
I find that useful.
Attacking java because of the performance is like attacking C because its
memory management system is held together with duct tape (stack overflows,
memory leaks, wild pointers, all so easy to do in C). It's a complete red
herring if you ask me...
Rob
next prev parent reply other threads:[~2001-06-21 0:17 UTC|newest]
Thread overview: 152+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-19 14:53 accounting for threads Dan Kegel
2001-06-19 14:57 ` J . A . Magallon
2001-06-19 15:44 ` ognen
2001-06-19 15:58 ` Alan Cox quote? (was: Re: accounting for threads) Dan Kegel
2001-06-19 16:02 ` David S. Miller
2001-06-19 16:12 ` Padraig Brady
2001-06-19 19:10 ` bert hubert
2001-06-19 19:18 ` Alan Cox
2001-06-19 19:32 ` bert hubert
2001-06-19 19:43 ` Alexander Viro
2001-06-20 15:22 ` Jes Sorensen
2001-06-20 15:33 ` Alexander Viro
2001-06-20 15:59 ` Threads are processes that share more bert hubert
2001-06-20 16:15 ` Alexander Viro
2001-06-20 18:48 ` Martin Devera
2001-06-20 19:19 ` Unknown PCI Net Device Greg Ingram
2001-06-20 22:53 ` Andreas Dilger
2001-06-20 22:56 ` Jeff Garzik
2001-06-20 23:00 ` Alan Cox
2001-06-20 22:08 ` Threads are processes that share more Stephen Satchell
2001-06-20 22:14 ` ognen
2001-06-20 23:10 ` J . A . Magallon
2001-06-24 23:47 ` Larry McVoy
2001-06-25 2:23 ` David S. Miller
2001-06-20 16:39 ` Alan Cox quote? (was: Re: accounting for threads) george anzinger
2001-06-20 18:35 ` Alexander Viro
2001-06-21 4:11 ` Rusty Russell
2001-06-21 23:37 ` Alexander Viro
2001-06-21 23:55 ` Alexander Viro
2001-06-22 14:53 ` Richard Gooch
2001-06-20 16:40 ` Jes Sorensen
2001-06-20 20:09 ` Rob Landley
2001-06-20 19:05 ` Victor Yodaiken
2001-06-20 14:35 ` Mike Porter
2001-06-20 11:56 ` Rob Landley
2001-06-19 16:02 ` Ben Pfaff
2001-06-19 16:09 ` Larry McVoy
2001-06-19 16:26 ` Matthew Kirkwood
2001-06-19 16:52 ` Larry McVoy
2001-06-19 18:18 ` Rob Landley
2001-06-19 23:31 ` Timur Tabi
2001-06-20 11:52 ` Rob Landley
2001-06-20 21:20 ` Albert D. Cahalan
2001-06-20 18:12 ` Rob Landley
2001-06-20 23:28 ` Dan Podeanu
2001-06-21 0:42 ` D. Stimits
2001-06-20 20:18 ` Rob Landley
2001-06-21 1:57 ` D. Stimits
2001-06-21 14:46 ` Idea: Patches-from-linus mailing list? (Was Re: Alan Cox quote? (was: Re: accounting for threads)) Rob Landley
2001-06-21 14:02 ` Alan Cox quote? (was: Re: accounting for threads) Jesse Pollard
2001-06-21 14:18 ` Rob Landley
2001-06-22 14:46 ` Mikulas Patocka
2001-06-22 13:29 ` Rob Landley
2001-06-24 21:41 ` J . A . Magallon
2001-06-24 16:55 ` Rob Landley
2001-06-24 22:30 ` J . A . Magallon
2001-06-24 18:21 ` Rob Landley
2001-06-25 13:48 ` J . A . Magallon
2001-06-24 22:39 ` Steven Walter
2001-06-24 23:50 ` Larry McVoy
2001-06-24 20:24 ` Rob Landley
2001-06-25 0:05 ` J . A . Magallon
2001-06-25 0:32 ` Gerhard Mack
2001-06-25 0:59 ` Davide Libenzi
2001-06-25 2:18 ` Galen Hancock
2001-06-20 14:59 ` Matthias Urlichs
2001-06-20 19:14 ` Victor Yodaiken
2001-06-20 21:01 ` RE:Why use threads ( was: Alan Cox quote?) David Schwartz
2001-06-20 21:26 ` Why " Victor Yodaiken
2001-06-20 22:18 ` David Schwartz
2001-06-20 22:41 ` Davide Libenzi
2001-06-20 22:47 ` [OT] " Jeff Garzik
2001-06-21 0:21 ` David Schwartz
2001-06-21 0:56 ` Davide Libenzi
2001-06-21 1:32 ` David Schwartz
2001-06-21 2:22 ` Davide Libenzi
2001-06-21 2:43 ` David Schwartz
2001-06-21 16:10 ` Davide Libenzi
2001-06-21 19:55 ` Marco Colombo
2001-06-20 22:43 ` Mike Castle
2001-06-21 1:43 ` David Schwartz
2001-06-19 17:10 ` Alan Cox quote? (was: Re: accounting for threads) Matti Aarnio
2001-06-19 17:20 ` Mike Castle
2001-06-19 17:37 ` Larry McVoy
2001-06-19 17:45 ` Mike Castle
2001-06-19 18:08 ` Georg Nikodym
2001-06-19 19:38 ` Georg Nikodym
2001-06-19 19:56 ` Michael Meissner
2001-06-19 17:53 ` Steve Underwood
2001-06-19 19:01 ` Alan Cox
2001-06-20 2:57 ` Michael Rothwell
2001-06-20 3:04 ` Larry McVoy
2001-06-20 3:38 ` John R Lenton
2001-06-20 10:21 ` john slee
2001-06-20 18:08 ` Larry McVoy
2001-06-20 16:21 ` Davide Libenzi
2001-06-20 9:14 ` Alan Cox
2001-06-22 2:36 ` Michael Rothwell
2001-06-19 17:36 ` Jonathan Lundell
2001-06-19 17:41 ` Larry McVoy
2001-06-19 20:57 ` David S. Miller
2001-06-19 21:11 ` Jonathan Lundell
2001-06-19 21:15 ` David S. Miller
2001-06-19 23:56 ` Jonathan Lundell
2001-06-20 0:19 ` Mike Castle
2001-06-20 0:28 ` Larry McVoy
2001-06-20 1:30 ` Ben Greear
2001-06-20 2:14 ` Mike Castle
2001-06-20 9:00 ` Henning P. Schmiedehausen
2001-06-20 11:25 ` [OT] Threads, inelegance, and Java Aaron Lehmann
2001-06-20 11:25 ` Rob Landley
2001-06-20 17:36 ` Martin Dalecki
2001-06-20 19:27 ` Mike Harrold
2001-06-20 17:46 ` Rob Landley
2001-06-20 19:53 ` Martin Dalecki
2001-06-20 17:53 ` Rob Landley
2001-06-21 7:45 ` Albert D. Cahalan
[not found] ` <mailman.993067219.29993.linux-kernel2news@redhat.com>
2001-06-20 20:16 ` Pete Zaitcev
2001-06-20 22:05 ` Alan Cox
[not found] ` <20010621000725.A24672@werewolf.able.es>
2001-06-20 19:15 ` Rob Landley [this message]
2001-06-21 9:40 ` Jonathan Morton
[not found] ` <mailman.993083762.1429.linux-kernel2news@redhat.com>
2001-06-21 3:13 ` Pete Zaitcev
2001-06-21 13:59 ` Rob Landley
2001-06-21 16:48 ` Adam Sampson
2001-06-20 15:12 ` Ben Greear
2001-06-20 15:44 ` Russell Leighton
2001-06-20 16:32 ` Davide Libenzi
2001-06-20 16:54 ` Russell Leighton
2001-06-20 17:03 ` Tony Hoyle
2001-06-20 15:10 ` Rob Landley
2001-06-20 20:23 ` Tony Hoyle
2001-06-21 8:12 ` Henning P. Schmiedehausen
2001-06-20 20:40 ` Richard B. Johnson
2001-06-20 20:48 ` Tony Hoyle
2001-06-20 21:00 ` Daniel Phillips
2001-06-20 21:06 ` Richard B. Johnson
2001-06-20 18:14 ` Henning P. Schmiedehausen
2001-06-20 16:53 ` Larry McVoy
2001-06-20 12:36 ` Rob Landley
2001-06-20 21:14 ` Aaron Lehmann
2001-06-20 18:09 ` Henning P. Schmiedehausen
2001-06-20 19:05 ` William T Wilson
2001-06-20 0:04 ` Alan Cox quote? (was: Re: accounting for threads) Chris Ricker
2001-06-20 0:59 ` Robert Love
2001-06-19 18:01 ` Alan Cox quote? Kai Henningsen
2001-06-19 18:49 ` Larry McVoy
2001-06-19 21:12 ` Richard Gooch
2001-06-19 22:50 ` Henning P. Schmiedehausen
2001-06-19 20:12 ` Henning P. Schmiedehausen
-- strict thread matches above, loose matches on Subject: below --
2001-06-20 21:13 [OT] Threads, inelegance, and Java Holzrichter, Bruce
2001-06-20 21:17 ` Richard B. Johnson
2001-06-21 4:10 Dan Kegel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0106201515530C.00776@localhost.localdomain \
--to=landley@webofficenow.com \
--cc=aaronl@vitelus.com \
--cc=hps@intermeta.de \
--cc=jamagallon@able.es \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox