Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: Fastest way to "pick without replacement"

by haukex (Archbishop)
on Nov 22, 2020 at 13:08 UTC ( [id://11124019]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11124019]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-25 20:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found