Skip to content

Comment on Show HN: Python can make 3M+ WebSocket keys per secondparent

Comments

Did you take a look at the C++ implementation of the hashing function they did? I didn't see a single call made there. They replaced python code that makes 5 calls into a single call.

That's a copy-pasted variation of this public-domain SHA1 code: http://ftp.funet.fi/pub/crypt/hash/sha/sha1.c surrounded by base64 decoding and encoding for a known-length binary text.

By inlining all library code you use, yes indeed, you too can also not make a single call.

I didn’t. I expect that it makes a difference, though for the observation that Python native calls are relatively slow.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.