This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

java.io fix and speedup


Hi,

The following fixes a small issue in FileInputStream. When
FileInputStream was finalized it would also force the finalization of
the underlying FileDescriptor. But the FileDescriptor could have been
shared with other FileInputStreams or RandomAccessFiles. The patch makes
the behaviour the same as for FileOutputStream.finalize(), which means a
noop. It also makes FileDescriptor a little bit more efficient by making
less system calls. (I only changed the Posix version.) This gives me a
small (~1%) speedup in IO intensive programs.

2003-01-02  Mark Wielaard  <mark@klomp.org>

	* java/io/FileInputStream.java (finalize): Don't explicitly
	finalize FileDescriptor.
	* java/io/FileDescriptor.java (position): New private field.
	* java/io/natFileDescriptorPosix.cc (write): Up position.
	(setLength): Use and set position.
	(seek): Set position.
	(getFilePointer): Return position.
	(read): Up position.

OK for branch and mainline?

Cheers,

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]