optimize size

This commit is contained in:
sparshg 2023-01-13 13:19:45 +05:30
parent e4c3716f80
commit d8bef225f9
3 changed files with 14 additions and 2 deletions

View File

@ -13,3 +13,13 @@ rand_distr = "0.4.3"
serde = { version = "1.0.152", features = ["derive"] }
serde_json = "1.0.91"
tinyfiledialogs = "3.9.1"
[profile.dev]
opt-level = 3
[profile.release]
opt-level = 'z' # Optimize for size
lto = true # Enable link-time optimization
codegen-units = 1 # Reduce number of codegen units to increase optimizations
panic = 'abort' # Abort on panic
strip = true # Strip symbols from binary*

View File

@ -1,3 +1,5 @@
#![windows_subsystem = "windows"]
mod asteroids;
mod nn;
mod player;

View File

@ -20,8 +20,8 @@ pub struct Player {
inputs: Vec<f32>,
pub outputs: Vec<f32>,
// asteroid_data: Vec<(f32, f32, f32)>,
last_shot: u8,
shot_interval: u8,
last_shot: u32,
shot_interval: u32,
pub brain: Option<NN>,
alive: bool,
pub lifespan: u32,