Toggle the puffin profiling with a feature flag

This commit is contained in:
Clément Renault 2023-07-11 10:26:50 +02:00 committed by Kerollmops
parent eef95de30e
commit 0b8bbd8750
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
2 changed files with 4 additions and 2 deletions

View file

@ -29,8 +29,9 @@ fn setup(opt: &Opt) -> anyhow::Result<()> {
async fn main() -> anyhow::Result<()> {
let (opt, config_read_from) = Opt::try_build()?;
puffin::set_scopes_on(true);
#[cfg(feature = "profile-with-puffin")]
let _server = puffin_http::Server::new(&format!("0.0.0.0:{}", puffin_http::DEFAULT_PORT))?;
puffin::set_scopes_on(cfg!(feature = "profile-with-puffin"));
anyhow::ensure!(
!(cfg!(windows) && opt.experimental_reduce_indexing_memory_usage),