On Fri, 13 Mar 2009, Daniel Stenberg wrote: Of course this is still really crappy in comparison. Here's a 10MB file:
libssh2: Got 10240000 bytes in 17629 ms = 580861.1 bytes/sec spin: 486 openssh: file 100% 10MB 9.8MB/s 00:01 17 seconds vs 1! I checked the code for the openssh SFTP implementation[*] and it does some funky stuff that might contribute to the speed. It sends off several requests for different chunks of the file at once (or at least before waiting for the response from the previous one) and then collects the responses when they arrive and sends off new requests. Thus it will keep the connection used better than libssh2's strictly serial approach. For downloads, I want to try out pre-fetching N bytes of data beyond what the app has asked for. For uploads, I want to try to "cache up" N bytes of upload data so that the lib will have a larger amount to send off once it does that. If it turns out to be working and make a difference, the N values could be made configurable. Anyone with opinions or other ideas on this or related stuff on how to improve transfer performance? [*] = http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/sftp-client.c?rev=1.86;content-type=text%2Fx-cvsweb-markup -- / daniel.haxx.se ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ libssh2-devel mailing list libssh2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libssh2-devel