perf: reduced memory consumption

This commit is contained in:
Ahmet Kaan Gümüş 2025-06-16 02:11:29 +03:00
parent 8cad7658ea
commit d375c9b564
8 changed files with 67 additions and 983 deletions

1034
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -8,6 +8,6 @@ members = [
chrono = { version = "0.4.41", features = ["serde"] }
# serde = { version = "1.0.219", features = ["derive"] }
# serde_json = "1.0.140"
tokio = { version = "1.45.0", features = ["full"] }
s2n-quic = "1.58.0"
tokio = { version = "1.45.1", default-features = false, features = ["io-util"] }
s2n-quic = "1.59.0"
bincode = "2.0.1"

View file

@ -9,4 +9,4 @@ chrono = { workspace = true }
tokio = { workspace = true }
s2n-quic = { workspace = true }
cpal = "0.16.0"
iced = { features = ["tokio"], git = "https://github.com/iced-rs/iced", rev = "d39022432c778a8cda455f40b9c12245db86ce45" }
iced = { default-features = false , features = ["tokio", "wgpu", "tiny-skia", "fira-sans"], git = "https://github.com/iced-rs/iced", rev = "89f480bdae951a31944302777b759661ec3c3e83" }

View file

@ -13,8 +13,8 @@ use tokio::sync::{
use crate::{
ClientConfig, MICROPHONE_BUFFER_LENGHT, SPEAKER_BUFFER_LENGHT,
audio::{play, record},
stream::{connect, disconnect_watcher},
voice::{play, record},
};
#[derive(Debug)]

View file

@ -1,9 +1,9 @@
use protocol::protocol::Speaker;
use tokio::sync::broadcast;
pub mod audio;
pub mod gui;
pub mod stream;
pub mod voice;
const MICROPHONE_BUFFER_LENGHT: usize = 1024 * 4;
const SPEAKER_BUFFER_LENGHT: usize = 1024 * 16 * 16;

View file

@ -90,7 +90,7 @@ pub async fn disconnect_watcher(
println!("Disconnected");
}
#[allow(unused_assignment)]
#[allow(unused_assignments)]
async fn send_signals(
mut send_stream: SendStream,
mut microphone_receiver: broadcast::Receiver<f32>,

View file

@ -7,8 +7,8 @@ use crate::Error;
const SIGNAL_DATA_LENGTH: usize = 4;
pub const NETWORK_DATA_LENGTH: usize = 6;
pub const SPEAKER_ACTION_CHANNEL_LENGTH: usize = 1024;
pub const AUDIO_DATA_SENDER_CHANNEL_LENGTH: usize = 1024 * 16 * 4;
pub const SPEAKER_ACTION_CHANNEL_LENGTH: usize = 128;
pub const AUDIO_DATA_SENDER_CHANNEL_LENGTH: usize = 1024 * 4;
pub const DEFAULT_SAMPLE_RATE: u32 = 44100;
pub type SpeakerWithDataAndAction = (SpeakerWithData, SpeakerAction);