cloudflare / lua-resty-cookie

Lua library for HTTP cookie manipulations for OpenResty/ngx_lua
347 stars 160 forks source link

Improve cookie baking performance #57

Closed jumper047 closed 1 year ago

jumper047 commented 1 year ago

String concatenation in lua is not very performant (see this question on SO). I tried to improve performance of the library and changed concatenation to table:concat. Performance on my usecase (to set cookie on every incoming request) improved from 215000 to 220000 requests per second. I originally created this PR in https://github.com/utix/lua-resty-cookie/ , because seems like it's current upstream, but decided to duplicate it here too for better observability

maurizioabba commented 1 year ago

yeah thank you for the PR. The project is currently unused, but I forgot to archive. As you did, please refer to https://github.com/utix/lua-resty-cookie/ for the latest upstream version