ville.mattila@stonesoft.com wrote:> Hi,
>
> The put_file method seems to be very slow compared to using
sftp''s
> put_file.
> I.e it take 2 seconds to transfert 5Mb file with sftp program and 20
> seconds when using sftp.put
> I think the @accumulating_data_packet is not used as intended.
> If I run my test program with ruby -d I get plenty of
> /session.rb:519: warning: instance variable @accumulating_data_packet not
> initialized messages.
Thanks for the report. I''m probably going to rework the entire channel
implementation during the rewrite/refactor that I''m in the middle of,
which should help improve SFTP performance. (Note, though, that Net::SSH
will never be as fast as any of the OpenSSH programs...in a Ruby vs. C
context, C will almost always win.)
I don''t think the acculating_data_packet is a problem (at least, in
this
case). The warnings are because I don''t set it to an initial value (in
the constructor, for instance).
One caveat: very little effort has been put into improving performance,
and this trend will probably continue until Net::SSH is
feature-complete. Once all the features are implemented, I''ll go back
through and look for ways to optimize. Basically, this means that the
current Net::SSH implementation is more of a proof-of-concept than a
real production-worthy SSH implementation.
- Jamis
--
Jamis Buck
jgb3@email.byu.edu
http://www.jamisbuck.org/jamis