Conversation
|
Can you share a benchmark test ? |
|
Sorry, but I can't - these results were obtained on test server in company I work. But I can test it again with reworked commit. Test itself is, actually, was pretty simple - Yandex Tank to generate load, and nginx with plugin, that generates some cookie and sets it with lua-resty-cookie. First result (215k rps) was obtained with package from luarepo, and second (220k) with my patch. I ran multiple tests (at least 5 for each case) to be sure this is not a coincidence. |
|
String buffer could be even faster: Though I think LuaJIT should (?) be able to compile the string concatenation above, but not sure as it is a bit more complicated than straight string .. string concatenation. |
Support for multiple values with the same key
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.