You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Performance improvement - handling buffers in plp.rs #226
Requesting single bytes from a tcp/ip stack incurs significant overhead.
I made a quick change to buffer coercion in src/tds/codec/column_data/plp.rs and in my specific case, performance improved by a factor of 3 (in my case when utilizing varchar).
The changes I made were as follows:
in fn decode
(comment this for loop out)
//for _ in 0..len {
// data.push(src.read_u8().await?);
//}
(replace with this)
data.resize(len as usize, 0u8); // actually allocate the space
src.read(&mut data).await?; // bulk read the data
Last else loop of decode (my case did not test this, concept code only):
//let byte = src.read_u8().await?;
//chunk_data_left -= 1;
//data.push(byte);
let mut buffer=Vec::with_capacity(chunk_data_left); // create a temporary storage for block
buffer.resize(chunk_data_left,0u8); // actually allocate the space
src.read(&mut buffer).await?; // bulk read the data
data.extend_from_slice(&buffer);
chunk_data_left=0;
changed the title [-]Performance improvement - handling strings in plp.rs[/-][+]Performance improvement - handling buffers in plp.rs[/+]on Jun 10, 2022
Activity
[-]Performance improvement - handling strings in plp.rs[/-][+]Performance improvement - handling buffers in plp.rs[/+]Try perf improvement to reading column data from tiberius-rs#226
MattJackson commentedon Sep 18, 2026
FYI: this is implemented in #449 (s9), currently in review. It'll be closed when that PR merges.
MattJackson commentedon Sep 24, 2026
Fixed in #449, shipped in v0.13.0 (https://github.com/tiberius-rs/tiberius/releases/tag/v0.13.0). Closing.
JasonCookSyncadd commentedon Sep 24, 2026
Thank you! I'll be able to utilize soon.