saviorand / lightbug_http

Simple and fast HTTP framework for Mojo! 🔥
MIT License
394 stars 27 forks source link

Remove unnecessary string manipulations #9

Closed saviorand closed 3 months ago

saviorand commented 5 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

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.

saviorand commented 3 months ago

Switched to using StringBuilder from https://github.com/thatstoasty/gojo in main. Closing this