[Vm-dev] Reed Solomon plugins & performance slow down

Robert Withers robert.withers at pm.me
Tue Jun 1 00:27:55 UTC 2021


Awesome, Levente! My bad. Thanks so much! So glad you were able to clear
it up. I will make the appropriate changes. As the field size is max
256: { 0-255 }, perhaps using ByteArrays everywhere would be better. I
should make sure ParrotTalk uses them as well. In 64-bit VMs are
"unsigned ints" 64 bits? Thus the DoubleWordArray?

---
Kindly,
Robert


On 5/31/21 8:05 PM, Levente Uzonyi wrote:
> Hi Robert,
>
> After a quick look, the problem seems to be that you're reading the first
> parameter, selfCoefficientsOop with #stackIntegerValue:, but the parameter
> is an array, not an integer, so it needs to be read with #stackObjectValue:.
> I don't think #stSizeOf: does any good when its argument is an integer
> oop, hence the crash.
>
> For simplicity and efficiency, I suggest you should pass a WordArray to
> the primtive (and use WordArrays in the image as well). It maps to the
> unsigned ints the primitive uses, and you can use #firstIndexableField:
> safely.
> Passing an Array would complicate things, as an Array can hold any kind of
> objects (which the primitive would have to check before using them), and
> its field size doesn't fit into an unsigned int on 64-bits.
>
> Also, validation of the arguments should be strict in the primitive. Have
> a look at e.g. DESPlugin >> #primitiveDESTransform to see how it validates
> its two arguments, a ByteArray and a WordArray.
>
>
> Levente
>
> P.S.: If the coefficients fit into smaller fields, it's worth to use a
> ByteArray or a DoubleByteArray instead of a WordArray for better
> performance.



More information about the Vm-dev mailing list