You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The permute benchmark function looks nearly like a recursive permutation function. While implementing it for lox, I wondered why it does not compute the correct permutation 6!. What does it compute?
"The number of permutations of n distinct objects is n factorial, usually written as n!"
The array is not initialized, which means nil is swapped. This is a bit pointless, but makes it a good test for the performance of storage strategies.
The count is what it is. It's not really counting the number of permutations, but rather the number of invocations of permute.
While I understand the desire to be able to understand and explain things, changing it would mean a quite substantial change to the benchmark, and what it is measuring. And I have no idea what the impact on the various language implementations is.
I am happy to consider a PR, that changes the benchmark and checks what the impact on all languages is, but I would expect that it's not really worth the effort...
The permute benchmark function looks nearly like a recursive permutation function. While implementing it for lox, I wondered why it does not compute the correct permutation 6!. What does it compute?
"The number of permutations of n distinct objects is n factorial, usually written as n!"
Like this:
The correct permutation of 6! should be 720
The text was updated successfully, but these errors were encountered: