classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Classpath / GCJ java.io Merge


From: Tom Tromey
Subject: Re: Classpath / GCJ java.io Merge
Date: 01 Mar 2003 13:08:20 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

>>>>> "Aaron" == Aaron M Renn <address@hidden> writes:

[ DataOutputStream ]

Aaron> Those shared methods can die, IMO.  They don't do much.  The
Aaron> allocation is an interesting point.  Classpath does it to avoid
Aaron> doing what gcj does: namely do tons of single byte writes.
Aaron> This would be hideously expensive in the JNI world.  Is
Aaron> allocation still a problem?

For me the swaying argument is that if there is a lot of allocation
inside the class, the user can't do anything about it.  But if there
are too many short writes, he can add a buffer.

In private mail (Aaron and I have had a conversation about this
off-list) I said that the performance of DataInputStream and
DataOutputStream probably doesn't matter.  But while looking elsewhere
today I found that serialization uses these classes.  So maybe
performance here is important.

We could always add a `byte[8]' buffer to these classes.
Synchronization isn't that expensive.  Or, for DataInputStream, we
could just leave it unsynchronized, like libgcj currently does -- I
don't know when it would make sense for two threads to read from a
DataInputStream.

>> For PrintStream it looks like there were conflicting goals.  From
>> libgcj:

Aaron> Hmm.  I kinda liked the Classpath approach, assuming it's
Aaron> actually a valid implementation strategy, because I'm lazy by
Aaron> nature.

Yeah, me too.  And I dislike duplication.

I notice the libgcj implementation routes everything through the
print(...,boolean) methods in PrintStream.  Presumably this is to make
it easier to subclass.  I haven't looked to see whether this behavior
is specified.

Tom




reply via email to

[Prev in Thread] Current Thread [Next in Thread]