labstack / echo

High performance, minimalist Go web framework
https://echo.labstack.com
MIT License
29.62k stars 2.22k forks source link

optimization: struct alignment #2636

Closed behnambm closed 4 months ago

behnambm commented 4 months ago

Pull requset to resolve #2632

Modified files with saved memory size:

File name Saved size(bytes)
binder.go 40
echo.go 8
echo_fs.go 8
group.go 16
ip.go 8
response.go 16
router.go 32
context.go 16
echo.go 8

Total saved size: 144

There was potential to further optimize the Echo struct in the echo.go file, but I chose to respect the readability of the codebase.

@aldas a quick review from you would be awesome whenever you’re free. Thanks!