Compile out assertions and cast checks in production builds
First off, locally testing with the GTK 3 version (vte-2.91) on top of master
with a time cat gigantic_650mb_file.txt
there was an 8% reduction in wall clock time. Easy big win.
In many other GNOME libraries we compile out assertions like g_assert()
but not things like g_return_if_fail()
or g_assert_cmpint()
) in release builds. Additionally, we compile out cast checks like FOO_BAR()
but not FOO_IS_BAR()
. Catch things during development phases, and don't take the perf hit in releases.
A release build in this case is where not get_option('buildtype').startswith('debug')
as it should apply to both plain
and release
builds using meson by distributions.
Pretty straightforward and already handled in numerous other projects.