>> > And I want to pose my favourite question about the 
>> performance again :-)
>> 
>> Did anyone do any profiling to check where the time is spent?
>> 
>> I've seen that for both outgoing packages and incoming 
>> packakges, there are no 
>> less than two extra memcpy()s (each way) of the data that we 
>> should be able to remove.

One code based bottleneck has been identified long time ago, it was in
the packet.c and in the function packet_read which read only 16 bytes at
a time. Afaik this has been correct. Otherwise the code is wuite clean
and profiling does not show any bottlenecks that affect the performance
enough to justify optimiziation.

The second issue (and far more important) is that libssh2 reads/writes
synchronously, ie. it does not utilize the available bandwidth to the
maximum. It sends one message and waits for a response. When
transferring large files this is really inefficient as the network
connection is idle when the libssh2 waits for a response.

As Sara mentioned in one of her earlier mails to this list other SSH
implementations (eg. OpenSSH sftp) use scattershot techniques
(asynchronous transfer) where several packets are sent immediately and
responses (and their ordering) is taken care of later when they arrive.
This way the bandwidth is utlized much more efficiently as it can be
used to send data while the remote end is processing previous messages.

How to achieve this with an API like libssh2 is a problem to be solved.
But the current synchronous transfer is appr. 50% slower than OpenSSH
sftp.

br,

/jUSSi
--
perl -e '$,=J; print "",""; $,=A; print "","";  $,=P;
print "",""; $,=H; print "",""; $,="\n"; print "","";' 

Disclaimer: This message and any attachments thereto are intended solely for
the addressed recipient(s) and may contain confidential information. If you
are not the intended recipient, please notify the sender by reply e-mail and
delete the e-mail (including any attachments thereto) without producing,
distributing or retaining any copies thereof. Any review, dissemination or
other use of, or taking of any action in reliance upon, this information by
persons or entities other than the intended recipient(s) is prohibited.
Thank you.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
libssh2-devel mailing list
libssh2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel

Reply via email to