# RelWithDebInfo default MSVC flags are pessimising

**URL:** https://discourse.cmake.org/t/relwithdebinfo-default-msvc-flags-are-pessimising/1160
**Category:** Usage
**Tags:** os:windows, gen:vs
**Created:** [May 7, 2020, 11:25am UTC](https://discourse.cmake.org/t/relwithdebinfo-default-msvc-flags-are-pessimising/1160 "2020-05-07T11:25:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![zakalawe](https://discourse.cmake.org/user_avatar/discourse.cmake.org/zakalawe/32/508_2.png) [@zakalawe](https://discourse.cmake.org/u/zakalawe)
#### Post date: [May 7, 2020, 11:25am UTC](https://discourse.cmake.org/t/relwithdebinfo-default-msvc-flags-are-pessimising/1160/1 "2020-05-07T11:25:05Z")

</div>

Have discovered a performance regression with Windows builds after switching to RelWithDebInfo (to enable crash reporting)

RelWithDebInfo uses /Ob1 whereas Release uses /Ob2 : and for modern C++ code, this is a large pesimisation.

Value comes from Windows-MSVC.cmake:  
` string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "${_MD} /Zi /O2 /Ob1 /DNDEBUG")`

What’s the recommended way to reset / override this in my project, while keeping everything else as compatible to future changes as possible?
