Skip to content

Comment on Eliminating Go bounds checks with unsafeparent

Comments

Obviously. You also need to profile to make sure this is actually a hit spot, deploying unsafe to remove bounds checks which account for ~0% of runtime is a waste of effort.

And as the essay mentions there are also “hints” you can give the compiler to fold bounds checks which may be sufficient.

AboutSource Built by g1lg1l

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