Skip Menu |

This queue is for tickets about the IO-Async-SSL CPAN distribution.

Report information
The Basics
Id: 103774
Status: resolved
Priority: 0/
Queue: IO-Async-SSL

People
Owner: Nobody in particular
Requestors: ioanr [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 0.14
  • 0.15
Fixed in: 0.17



Subject: sslwrite gives very poor performance
Hi,

I noticed that Net::Async::Webservice::S3 was taking > 5mins to upload a 165MiB file and using 100% cpu, while aws cli took < 20secs and used ~25-30%.

I tracked down the issue to IO::Async::SSL::sslwrite and found that $buf was being unpacked from @_. I can see you were using $_[1] rather than $buf later on anyway, so I guess it wasn't intended :-)

This teeeeeeeny patch brings performace in line with expectations.

Thanks!



Subject: 0001-Don-t-copy-buffer-from-args-it-s-a-performance-kille.patch
From ff24d0b26dae0dfa91f9c0a003211fb762572387 Mon Sep 17 00:00:00 2001 From: Ioan Rogers <ioan.rogers@sophos.com> Date: Thu, 16 Apr 2015 11:58:58 -0700 Subject: [PATCH] Don't copy buffer from args, it's a performance killer --- lib/IO/Async/SSL.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/IO/Async/SSL.pm b/lib/IO/Async/SSL.pm index 6602976..a5bfdf2 100644 --- a/lib/IO/Async/SSL.pm +++ b/lib/IO/Async/SSL.pm @@ -115,7 +115,7 @@ sub sslread sub sslwrite { my $stream = shift; - my ( $fh, $buf, $len ) = @_; + my ( $fh, undef, $len ) = @_; my $ret = $stream->_syswrite( $fh, $_[1], $len ); -- 2.1.4
Thanks; applied. -- Paul Evans