On Tue, 14 Dec 2010, Peter Stuge wrote:

It will use a bit more memory, but a lot less CPU,

It's a solid optimization in many cases, but the impact obviously depends on list length. I guess we don't have many enough packets on that list in libssh2 for the list itself to be a problem, or..?

I don't think we can easily switch to using arrays instead of the lists we have. Also, the lists I've added for the pipelined SFTP stuff are typically not searched through very far and we don't search in them so we can't bsearch there.

I do think we can use hash tables for some of the incoming packet storage (both SFTP and regular SSH layer) but I'm not convinced we have a lot to gain from that.

BTW, I did re-run my SFTP download tests against localhost with everything built with gcc -O2 and then we reach 40MB/sec and thus openssh is only ~10% faster.

I'll see if I can extract some additional info using some profiling later on.

--

 / daniel.haxx.se
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Reply via email to