Optimize individual (standard) library components

In my application I’ve found that in debug builds the speed of the blake3 module is very noticeable (3GB/s vs 60MB/s) so I’d like to speed that part up while not ruining the debugging experience in other parts.
My current solution is a small wrapper module with .optimize = .ReleaseFast that I link against as a static library. It’s a bit cumbersome and it’s not the only think where I’d like to do that. Is there a more convenient way of achieving what I want here?

@setRuntimeSafety(false) should do the trick. You want to use this in as small a scope as possible though. It’s scope bound as the langref says.

2 Likes

Also relevant: replace @setRuntimeSafety with @optimizeFor · Issue #978 · ziglang/zig · GitHub