cybersoulK

Results 57 comments of cybersoulK

i am reading here: https://github.com/bincode-org/bincode/blob/trunk/src/varint/encode_unsigned.rs is says that it should be 3 bytes? but that's a huge downside, because most of the time, the value will be above 255, more...

for example. in my engine implementation, f32 is squeezed into a u16 which is the perfect size, so the data that is handled over the network is 50% more. and...

We can use a better method "if the MSB is set, there's more data" U16 ``` 0 to 128 - 1 byte, 128 to 32768 - 2 bytes, 32768 to...

@VictorKoenders but how do you think of 0 to 128 - 1 byte, 128 to 32768 - 2 bytes, 32768 to u16::Max - 3 bytes, i am not an expert,...

also in the case of ids, where they are generalized by a u32, but could be in the range u8, u16 and u32, to try and stay as small as...

@VictorKoenders it's not niche lol. this is fundamental in game networking

@VictorKoenders what do you recommend on a entity Id where you want to have 0 - u8::Max / 2. - 1 byte u8::Max / 2 - u16::Max / 2 -...

i will try. but this case still gives 3 bytes @VictorKoenders #[derive(Encode, Decode, Debug, Clone)] struct U16(u16); fn main() { let test = U16(270); let m = bincode::encode_to_vec(&test, bincode::config::standard()).unwrap(); }

@VictorKoenders i just realized that in my engine, using with_fixed_int_encoding will double the serialization performance, and keep very similar size, so having with_fixed_int_encoding is very important for my project. but...

i read it before. "Currently we have not found a compelling case to respect #[repr(...)]" that's why i am providing with a case