classpath
[Top][All Lists]
Advanced

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

gnu.java.nio.channels.FileChannelImpl


From: David P Grove
Subject: gnu.java.nio.channels.FileChannelImpl
Date: Mon, 10 May 2004 17:31:28 -0400


I haven't taken a deep look at this code, but I have one suggestion based on the performance profiling of Jikes RVM and classpath 0.09 I was doing the end of last week.  

Would it be possible to change the native methods to take the file descriptor as an additional argument?  In the current Java/native breakdown the very first thing most native methods do is callback via JNI to acquire the fd.  This is much less efficient (at least on Jikes RVM, and I suspect on most JNI-based VMs) then loading the fd in the Java code and then passing it as an argument to the native methods that need it.   You might need to add a wrapper method in some cases if the native method is called by other classes, for example:

public native int read();

becomes

public int read() {
  return readImpl(fd);
}
private native int readImpl(int fd);


--dave
reply via email to

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