Skip to content

Commit

Permalink
Enable thin lto
Browse files Browse the repository at this point in the history
Ensure opt-level is 3
  • Loading branch information
VirxEC committed Jun 3, 2024
1 parent b2e4bdf commit 7502011
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "rocketsim_rs"
description = "Rust bindings for the RocketSim project"
version = "0.30.0"
version = "0.30.1"
edition = "2021"
license = "MIT"
repository = "https://github.com/VirxEC/rocketsim-rs"
Expand All @@ -21,6 +21,8 @@ cxx-build = "1.0.122"

[profile.release]
lto = true
codegen-units = 1
panic = "abort"

[features]
default = ["debug_logging", "bin"]
Expand Down
2 changes: 2 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ fn main() {

if !cfg!(debug_assertions) {
builder.define("RS_MAX_SPEED", "1");
builder.flag_if_supported("-flto=thin");
builder.opt_level_str("3");
}

builder
Expand Down
2 changes: 1 addition & 1 deletion examples/real_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{
};

fn main() {
const TICKS: u32 = 50000;
const TICKS: u32 = 200_000;

// load in assets
rocketsim_rs::init(None);
Expand Down
4 changes: 1 addition & 3 deletions examples/thread_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ use rocketsim_rs::sim::{Arena, CarConfig, Team};
use std::time::Instant;

fn main() {
const TICKS: u32 = 250_000;
const TICKS: u32 = 1_000_000;

// load in assets
rocketsim_rs::init(None);

let mut arena = Arena::default_standard();

let _ = arena.pin_mut().add_car(Team::Blue, CarConfig::octane());
let _ = arena.pin_mut().add_car(Team::Blue, CarConfig::octane());
let _ = arena.pin_mut().add_car(Team::Blue, CarConfig::octane());

let _ = arena.pin_mut().add_car(Team::Orange, CarConfig::octane());
let _ = arena.pin_mut().add_car(Team::Orange, CarConfig::octane());
let _ = arena.pin_mut().add_car(Team::Orange, CarConfig::octane());

Expand Down

0 comments on commit 7502011

Please sign in to comment.