Back to all reviewers

use `-prod` for performance

vlang/v
Based on 2 comments
Markdown

Always use the `-prod` compiler flag when building performance-critical code or running benchmarks. The `-prod` flag automatically enables essential optimization settings including `-O3` and `-flto` (Link Time Optimization), eliminating the need to manually specify these common performance flags.

Performance Optimization Markdown

Reviewer Prompt

Always use the -prod compiler flag when building performance-critical code or running benchmarks. The -prod flag automatically enables essential optimization settings including -O3 and -flto (Link Time Optimization), eliminating the need to manually specify these common performance flags.

This approach ensures consistent optimization across different build scenarios and reduces the likelihood of forgetting important performance flags. For additional architecture-specific optimizations, you can combine -prod with targeted flags:

# For performance-critical applications
v -cc gcc -prod -cflags "-std=c17 -march=native -mtune=native" .

# For benchmarking
v -prod run bench/bench.v

Using -prod as the foundation provides a reliable baseline for performance optimization while allowing for additional customization when needed.

2
Comments Analyzed
Markdown
Primary Language
Performance Optimization
Category

Source Discussions