From 4d7bf6c50eda970ac4998f10f5e46006dffb6ca2 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 30 Apr 2022 01:43:00 -0500 Subject: significantly optimize reading Vec unfortunately, this introduces the requirement of using rust nightly --- azalea-protocol/src/read.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'azalea-protocol/src/read.rs') diff --git a/azalea-protocol/src/read.rs b/azalea-protocol/src/read.rs index 88fe95cf..4f8b52af 100755 --- a/azalea-protocol/src/read.rs +++ b/azalea-protocol/src/read.rs @@ -149,7 +149,11 @@ where if let Some(compression_threshold) = compression_threshold { buf = compression_decoder(&mut buf.as_slice(), compression_threshold).await?; } + + let start_time = std::time::Instant::now(); + println!("decoding packet"); let packet = packet_decoder(&mut buf.as_slice(), flow).await?; + println!("decoded packet in {}ms", start_time.elapsed().as_millis()); Ok(packet) } -- cgit v1.2.3