3 ms·
Just wondering, if you don't care about that much about the performance for your application, is it okay to use the runtime checks compilation in production? L
by DanielHB 2y ago
Just wondering, if you don't care about that much about the performance for your application, is it okay to use the runtime checks compilation in production?
Like say I have a really weird issue I can't seem to find locally, can I switch my production server to this different compilation mode temporarily to get better logs? Can I run my development environment with it on all the time?
- laserbeam 2y agoCertain classes of programs should be built as ReleaseSafe rather than ReleaseFast to keep many of the runtime checks. It's perfectly reasonable to write a database and build as ReleaseSafe, but also make a game and build it as ReleaseFast.
- sciolistse 2y agoYou can definitely use ReleaseSafe, you can also switch modes during compilation. so you can call '@setRuntimeSafety(false)' at the start of a scope to disable runtime safety for performance critical sections.
- DanielHB 2y agothis is an amazing feature
- jonathrg 2y agoSure, an application built in Debug mode with a compiled language is going to be much faster than if you implemented it in an interpreted language. Given how much of the world runs on Python, PHP and Javascript, your zig application in debug mode is probably going to run just fine.