I came across this package in search of a quick sign implementation. I noticed a few optimization possibilities in cycles. Moreover, I found the sign implementation very inefficient, because all you care about is the length of the result of cycles(p), so one can take the same code and replace every array concatenation by a += 1. That reduces memory allocation and yields significant performance improvements.
I came across this package in search of a quick
sign
implementation. I noticed a few optimization possibilities incycles
. Moreover, I found thesign
implementation very inefficient, because all you care about is the length of the result ofcycles(p)
, so one can take the same code and replace every array concatenation by a+= 1
. That reduces memory allocation and yields significant performance improvements.