Default build type for gst-plugins-rs

So, I’m compiling from source. If I understand meson correctly, the default overall build type is buildtype=debugoptimized.

However, then compiling with -Drs=enabled, the rust parts end up in some target/debug directory and cargo seems to be running with the debug profile, and rustc has -C opt-level=1. If I explicitly say --buildtype release, then rustc gets -C opt-level=3 and also lto and artifacts end up under target/release.

Looking at the gst-plugins-rs/Cargo.toml, we see that the release profile is basically “optimized for speed but with debug info”, which is what I would expect of “debugoptimized” anyway.

[profile.release]
lto = true
opt-level = 3
debug = true
panic = 'unwind'

[profile.dev]
opt-level = 1
lto = "off"

Am I missing something, or is this intentional for some reason for this inconsistency?

If you compile without any optimizations at all, various plugins (and their tests) are multiple orders of magnitude slower and basically unusable.

1 Like

Yes, that’s why I was wondering why I seem to get a debug build with a low optimization level by default.

Ah you mean why debugoptimized only has minor optimizations and is the same as debug? That seems like a limitation of the cargo/meson wrapper script, and can probably be solved. Please create an issue in gitlab if that’s a concern for you.

1 Like

Thank you, it’s not really an issue — I just found it a bit confusing and wondered whether the default behavior was this way was intentionally. I guess opt-level = 1 is not “without optimizations”, so it can reasonably be called “debugoptimized”.