sergot / openssl

OpenSSL bindings for Perl 6
MIT License
14 stars 31 forks source link

Use faster buf8.new multi in read() #37

Closed MasterDuke17 closed 7 years ago

MasterDuke17 commented 7 years ago

buf8.new has a multi that takes a native array which is much faster.

Passes all the tests.

A profile of use HTTP::UserAgent; my $ua = HTTP::UserAgent.new; my $response = $ua.get("https://perl6.org"); say $response.content.chars used to show 1 million+ calls each to IterationBuffer's push and Int's prefix:<--> and take an average of 2s. After this change it doesn't have either of those 1 million+ calls and takes an average of 1s.