~quf/cleave

952c1f9f476e21561c874b0167bafd6a0320f2cd — Lukas Himbert 2 years ago 12b3519 trunk
make perf feature opt-in
2 files changed, 4 insertions(+), 1 deletions(-)

M Cargo.toml
M src/subcommand/run/mod.rs
M Cargo.toml => Cargo.toml +1 -1
@@ 5,7 5,7 @@ edition = "2021"
default-run = "cleave"

[features]
default = ["perf"]
default = []
flitter = [] # import from flitter .scm files
test = ["rand", "rand_distr"] # for generating a test database
perf = ["ringbuffer"] # performance reports (FPS/frame draw times)

M src/subcommand/run/mod.rs => src/subcommand/run/mod.rs +3 -0
@@ 138,7 138,10 @@ pub fn main(db_path: &std::path::Path, layout_file: Option<&std::path::Path>) ->
            match inp {
                input::Action::Quit => {
                    log::debug!("Quitting");

                    #[cfg(feature = "perf")]
                    log::debug!("{} frames drawn.", frames);

                    run_transaction(&mut conn, |tx| db::update_run(tx, &state.timer))
                        .map_err(|e| format!("Couldn't update run data: {}", e))?;
                    // TODO: if this fails, print run data to stdout for recovery