sujiacong / libsocks_client

SOCKS client rust implementation
MIT License
0 stars 0 forks source link

Reduce allocations by re-using buffer #2

Closed Sytten closed 6 days ago

Sytten commented 1 week ago

The library does a lot of allocations for the various buffers of requests/responses. The Client could allocate a buffer similar to what tokio-socks does here: https://github.com/sticnarf/tokio-socks/blob/master/src/tcp/socks5.rs#L271-L273

sujiacong commented 6 days ago

Thank you for your suggestion. I have added a Vec buffer structure to support client buffer reuse, which is available in version 0.1.2