Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Boosting workaround [Was: PDL's error or mine?]by jo37 (Deacon) |
on Feb 23, 2023 at 11:33 UTC ( [id://11150550]=note: print w/replies, xml ) | Need Help?? |
Opened an issue as suggested, including the strange behaviour as discovered by choroba Interestingly, the search for a suitable workaround resulted in a remarkable boost for my specific application. Here the sets represent indices from another piddle and one operand is taken from a piddle holding several sets, which requires equal dimensions for all sets. This is achieved by padding the sets with BAD values at the end. With a small modification, the values can be placed just at the position they represent and the remaining values set to BAD. Then an intersection may be performed almost with a simple dice. E.g. The result in $intersect can be found much faster with dice than with setops for a large sized $data. An older issue with setops revealed the usage of uniq within setops, which sorts the data making it O(N log N), while the dice approch should be O(N). In my application there is no overhead in constructing $full1. Probably this is already described somewhere else.
Update 1:
Update 2: Greetings,
In Section
Seekers of Perl Wisdom
|
|