Skip to content

Commit

Permalink
use recycler for packetbatch allocation (#4381)
Browse files Browse the repository at this point in the history
use recycler for packetbatch allocation
  • Loading branch information
lijunwangs authored Jan 10, 2025
1 parent b94b9f6 commit 9624dad
Showing 1 changed file with 4 additions and 2 deletions.
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 @@ -888,10 +888,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

0 comments on commit 9624dad

Please sign in to comment.