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.
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.