diff options
| author | mat <github@matdoes.dev> | 2022-04-30 01:43:00 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-04-30 01:43:00 -0500 |
| commit | 4d7bf6c50eda970ac4998f10f5e46006dffb6ca2 (patch) | |
| tree | 8b677c96440dfae63132303df3fa9bf37d3bcf65 /azalea-protocol/src/read.rs | |
| parent | c8c356685d9050d166226fb01353faba5fc00f4a (diff) | |
| download | azalea-drasl-4d7bf6c50eda970ac4998f10f5e46006dffb6ca2.tar.xz | |
significantly optimize reading Vec<u8>
unfortunately, this introduces the requirement of using rust nightly
Diffstat (limited to 'azalea-protocol/src/read.rs')
| -rwxr-xr-x | azalea-protocol/src/read.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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) } |
