Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: How to do popcount (aka Hamming weight) in Perl

by LanX (Saint)
on Sep 24, 2017 at 10:37 UTC ( [id://1199988]=note: print w/replies, xml ) Need Help??


in reply to How to do popcount (aka Hamming weight) in Perl (popcount References)

> Improvements welcome.

Performance wise?

I think a pre computed lookup table is the way I'd go.

An array with 2**16 entries should be a good compromise between time and memory complexity.

(Since Perl doesn't fit into a CPU's line cache)

Sorry too busy to code it for you :)

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

  • Comment on Re: How to do popcount (aka Hamming weight) in Perl

Log In?
Username:
Password:

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

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

    No recent polls found