Re: [JSch-users] Very confused why I'm not getting any response. SFTP performance improvements
Status: Alpha
Brought to you by:
ymnk
From: Chris T. <chr...@gm...> - 2007-06-14 09:51:57
|
wait a second, let me get this straight. This guy sends code and offers to make a significant contribution to the code and improve it in areas relating to his problem and you're response is that "we don't need your help, we'll do it ourselves thanks" Did I just read that correctly ? On 14/06/07, Atsuhiko Yamanaka <ym...@jc...> wrote: > Hi, > > +-From: ym...@jc... (Atsuhiko Yamanaka) -- > |_Date: Thu, 14 Jun 2007 11:22:15 +0900 __ > | > | +-From: "Manuel Ordonez" <man...@ho...> -- > | |_Date: Wed, 13 Jun 2007 15:57:35 -0400 ________________ > | | > | |These changes will require no sleep time per say, this is where most > | |of the performance comes from, we wait based on object state chage. > | |If I thought I could provide the code here without getting in trouble, > | |I would. > > |Thank you for your kindness, but we don't need it. It will not be difficult, > |but it will require carefulness. We will try to do it by ourself. > > > Here is a quick hack to improve the performance, > > diff -Naur jsch-0.1.33/src/com/jcraft/jsch/Channel.java jsch-0.1.33.new/src/com/jcraft/jsch/Channel.java > --- jsch-0.1.33/src/com/jcraft/jsch/Channel.java Wed Mar 14 19:03:43 2007 > +++ jsch-0.1.33.new/src/com/jcraft/jsch/Channel.java Wed Jun 13 18:42:54 2007 > @@ -121,6 +121,8 @@ > > Session session; > > + int notifyme=0; > + > Channel(){ > synchronized(pool){ > id=index++; > @@ -347,7 +349,11 @@ > void setLocalWindowSize(int foo){ this.lwsize=foo; } > void setLocalPacketSize(int foo){ this.lmpsize=foo; } > synchronized void setRemoteWindowSize(int foo){ this.rwsize=foo; } > - synchronized void addRemoteWindowSize(int foo){ this.rwsize+=foo; } > + synchronized void addRemoteWindowSize(int foo){ > + this.rwsize+=foo; > + if(notifyme>0) > + notifyAll(); > + } > void setRemotePacketSize(int foo){ this.rmpsize=foo; } > > public void run(){ > diff -Naur jsch-0.1.33/src/com/jcraft/jsch/Session.java jsch-0.1.33.new/src/com/jcraft/jsch/Session.java > --- jsch-0.1.33/src/com/jcraft/jsch/Session.java Fri May 11 05:19:18 2007 > +++ jsch-0.1.33.new/src/com/jcraft/jsch/Session.java Wed Jun 13 18:44:12 2007 > @@ -1110,19 +1110,42 @@ > } > packet.unshift(command, recipient, s, length); > > + /* > synchronized(c){ > if(c.rwsize>=length){ > c.rwsize-=length; > break; > } > } > + */ > > } > > - > + /* > // try{Thread.sleep(10);} > try{ Thread.sleep(100); } > catch(java.lang.InterruptedException e){}; > + */ > + > + synchronized(c){ > + if(in_kex){ > + continue; > + } > + if(c.rwsize>=length){ > + c.rwsize-=length; > + break; > + } > + try{ > + c.notifyme++; > + c.wait(); > + } > + catch(java.lang.InterruptedException e){ > + } > + finally{ > + c.notifyme--; > + } > + } > + > } > _write(packet); > } > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > JSch-users mailing list > JSc...@li... > https://lists.sourceforge.net/lists/listinfo/jsch-users > |