in reply to Re^3: Fastest way to "pick without replacement"
in thread Fastest way to "pick without replacement"

Anyway in my experience you are doing micro-optimization here

This was mostly to satisfy my curiosity and perhaps provide an interesting challenge, I'm not really optimizing anything - I always had a gut feeling that splice might be kind of slow (and it probably still is on very large arrays), so it's nice to see that in this test it's actually quite the opposite.

  • Comment on Re^4: Fastest way to "pick without replacement"

Replies are listed 'Best First'.
Re^5: Fastest way to "pick without replacement"
by LanX (Saint) on Nov 22, 2020 at 21:54 UTC
    Yes it's impressive how efficient splice is.

    Perl's array implementation is very clever in many ways, to approach the performance of linked lists, without loosing the benefits of O(1) random access to members.

    But I don't remember it being good at bridging holes....

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery