I have a project where I want to have checked arithmetic by default, except for one performance sensitive spot. Unfortunately, VB.Net doesn't have an 'unchecked' block.

Ideally the framework would have some sort of integer type with explicitly unchecked arithmetic, but I didn't find anything like that. I did find that expression trees have binary expressions for unchecked operations, but the delegate overhead cancels out the unchecked advantage (and then some).

Currently I'm converting the inputs to UInt64/Int64 before doing the arithmetic, then converting back (with a bitwise And to ensure in-range). It's about 50% slower than unchecked arithmetic (according to profiling).

Moving the arithmetic-sensitive part to a project with unchecked arithmetic might work, but it seems like overkill to give it an assembly all to itself.