Closed saviorand closed 3 months ago
Currently we manipulate strings in several places when processing requests and/or responses. E.g here in encode function: https://github.com/saviorand/lightbug_http/blob/1ab6beb32d0180d69e2350583085281ef797d93e/lightbug_http/http.mojo#L255
encode
For best performance, we should avoid this and work on byte objects instead/reuse and don't allocate memory in hot paths. In addition, there are known issues with performance in Mojo when doing string operations.
Switched to using StringBuilder from https://github.com/thatstoasty/gojo in main. Closing this
Currently we manipulate strings in several places when processing requests and/or responses. E.g here in
encode
function: https://github.com/saviorand/lightbug_http/blob/1ab6beb32d0180d69e2350583085281ef797d93e/lightbug_http/http.mojo#L255For best performance, we should avoid this and work on byte objects instead/reuse and don't allocate memory in hot paths. In addition, there are known issues with performance in Mojo when doing string operations.