> from approx 1.1 to 0.0006 secs. That's quite an improvement!
:)
Be aware of the stop gap nature of the module, and its WARNING:
> At some point, these problems will be addressed in core, but in the
> meantime...
> This module depends on internal details of the REPRs
> of the involved types
Shorter, and much more readable, I'd say:
my Blob $blob = blob-from-carray($ed.data, size=>$ed.data_size);
say "bindata = { now - INIT now }";
The term "now" is short for "DateTime.now.Instant"
The INIT phaser is run when the program is started: it returns the value that
was obtained
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
> 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:
Hi!
> $ed.data.head($ed.data_size)
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"
> > my uint8 @data = $ed.data[0..$ed.data_size-1].Array;
> > my Blob $bindata = Blob[uint8].new(@data);
>
>
> my Data $ed = await $yenc_promise;
The promise must initialize each element of the CArray[uint]. It looks
pretty quick; I'm guessing it's low-level code doing that.
> my uint8 @data = $ed.data[0..$ed.data_size-1].Array;
> my Blob $bindata = Blob[uint8].new(@data);
Afaict that's a total of
On my MacBook, with Raku 2020.01 built on MoarVM version 2020.01.1
changing:
$ed.data[^$ed.data_size]
to:
$ed.data.head($ed.data_size)
cut the time in half.
I cannot speak to what might be happening with the Promises.
Test code:
class Foo {
has @.data = 0 xx (1024 **
Thanks for the answer.
There's a slight performance improvement, but It still takes more than 1 second:
Code:
my Instant $init3 = DateTime.now().Instant;
#my Blob $bindata = Blob[uint8].new(@data);
my Blob $bindata = Blob[uint8].new($ed.data[^$ed.data_size]);
say "Bindata in
On Tue, Jun 16, 2020 at 5:18 PM David Santiago wrote:
> my uint8 @data = $ed.data[0..$ed.data_size-1].Array;
> my Blob $bindata = Blob[uint8].new(@data);
Not absolutely sure, but it seems like you are copying the data twice.
Try just
my $bindata = Blob.new($ed.data[^$ed.data_size]);
Hi!
Can i get some help in trying to improve the performance of the
following snippet?
The following code runs inside a react block that it's waiting for
channel values.
The promise $yenc_promise returns a CStruct with a CArray[uint] $data
and a uint8 $data_size.
my Instant $init =
10 matches
Mail list logo