BLUE
Profile banner
JC
Jon Caruana
@plc.joncaruana.com
He/him. Dad. Software developer by day. Home automator by night. Puzzle solver and occasional puzzle author (encodingcard.com).
64 followers178 following165 posts
JCplc.joncaruana.com

It is unintuitive but David is right. The thing to observe is a 512 bit number puts you into a scenario where every int is an array. Operations like & are surprisingly costly and each allocates. But python’s long_format_binary is implemented in C with what looks like a single allocation: the string.

0

Profile banner
JC
Jon Caruana
@plc.joncaruana.com
He/him. Dad. Software developer by day. Home automator by night. Puzzle solver and occasional puzzle author (encodingcard.com).
64 followers178 following165 posts