develooper Front page | perl.perl6.users | Postings from June 2020

Re: Help converting CArray[uint8] to Blob

Thread Previous | Thread Next
From:
David Santiago
Date:
June 17, 2020 17:01
Subject:
Re: Help converting CArray[uint8] to Blob
Message ID:
CAO5X0j4k4EUPK1Nb2rrbmRySEaABgcSM3S_6kZgKYJORtC+4Jg@mail.gmail.com
Super!

That what i was looking for, i changed the code to:

my Instant $init = DateTime.now.Instant;
my Blob $blob = blob-from-carray($ed.data, size=>$ed.data_size);
say "bindata =  {DateTime.now.Instant-$init}";


Output:

Bindata= 0.00060054

So it passed from approx 1.1 to 0.0006 secs. That's quite an improvement!

Thank you so much.

Best regards,
David Santiago


Ralph Mellor <ralphdjmellor@gmail.com> escreveu no dia quarta,
17/06/2020 à(s) 11:57:
>
> > Unfortunately, i get the error "Error X::AdHoc+{X::Await::Died}+{X::React::Died}: Don't know how many
> elements a C array returned from a library"
>
> I googled the error message and got a bunch of matches including this:
>
> https://stackoverflow.com/questions/51081475/getting-data-out-of-native-pointers
>
> This will show the way to maximize the speed because it minimizes
> the *number* of copy operations (to one) and expense of the copy
> (by making it native code).
>
> hth

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About