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.
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 toIterationBuffer
'spush
andInt
'sprefix:<-->
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.