Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use recycler for packetbatch allocation #4381

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions streamer/src/nonblocking/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use {
solana_keypair::Keypair,
solana_measure::measure::Measure,
solana_packet::{Meta, PACKET_DATA_SIZE},
solana_perf::packet::{PacketBatch, PACKETS_PER_BATCH},
solana_perf::packet::{PacketBatch, PacketBatchRecycler, PACKETS_PER_BATCH},
solana_pubkey::Pubkey,
solana_quic_definitions::{
QUIC_CONNECTION_HANDSHAKE_TIMEOUT, QUIC_MAX_STAKED_CONCURRENT_STREAMS,
Expand Down Expand Up @@ -889,10 +889,12 @@ async fn packet_batch_sender(
coalesce: Duration,
) {
trace!("enter packet_batch_sender");
let recycler = PacketBatchRecycler::default();
let mut batch_start_time = Instant::now();
loop {
let mut packet_perf_measure: Vec<([u8; 64], Instant)> = Vec::default();
let mut packet_batch = PacketBatch::with_capacity(PACKETS_PER_BATCH);
let mut packet_batch =
PacketBatch::new_with_recycler(&recycler, PACKETS_PER_BATCH, "quic_packet_coalescer");
let mut total_bytes: usize = 0;

stats
Expand Down
Loading