perf(http3): don't re-allocate outbound datagram to prefix with varint
When sending an HTTP3 datagram, we prefix it with the session id. In order to do so, we write the session ID into a new Encoder and then copy the entire datagram over into that Encoder.
https://github.com/mozilla/neqo/blob/3001a3a56f2274eaafaa956fb394f0817f526ae7/neqo-http3/src/features/extended_connect/webtransport_session.rs#L415-L418
We might be able to do better, e.g. passing session ID and datagram down separately.
I will take a look!
This is not easily possible I think. We need ownership of the data in QuicDatagrams::add_datagram when we push it into the queue as a new QuicDatagram so we need to reallocate at some point anyways, might as well do it here while we prefix the session ID.
https://github.com/mozilla/neqo/blob/3001a3a56f2274eaafaa956fb394f0817f526ae7/neqo-transport/src/quic_datagrams.rs#L170
Maybe we could do something with lifetimes there, but I'm not experienced enough with Rust to assess if that would be at all feasible (and going by Max's "if you're using lifetimes you're probably doing something wrong" advice, probably not).