If the overhead of run-time checks that were not optimized away is really an issue, you can always suppress them (pragma Suppress, or a switch like -gnatp).
- Not for use for a complex, dynamic system.
- Good for a Monte-Carlo simulation on your PC: if the “Debug” version, with the checks, has passed the first iteration, the checks might be (depending on your model) useless for the next millions of iterations. So you can re-run with the “Optimized-no-checks” build mode and get your results faster.
- It is also good for benchmarking tests. Then you discover that you can produce Ada code that is much faster than equivalent C code, with a lot less effort…
Cf: Generic Image Decoder (GID) version 13 - #2 by zertovitch