unsafe calls are slightly faster, but come with a few restrictions like not being able to reenter into Haskell code, and not releasing the capability. As we don't reenter, and the native code is short-lived, using unsafe makes more sense.
Echidna built with this change showed a ~1.5% improvement in execution time on 1000000 runs in a test codebase.
Description
unsafe
calls are slightly faster, but come with a few restrictions like not being able to reenter into Haskell code, and not releasing the capability. As we don't reenter, and the native code is short-lived, usingunsafe
makes more sense.Echidna built with this change showed a ~1.5% improvement in execution time on 1000000 runs in a test codebase.
References:
Checklist