Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create empty lua tables with specified initial capacity as much as po…
…ssible (valkey-io#1092) Currently, we create a Lua table without initial capacity even when the capacity is known. As a result, we need to resize the Lua tables repeatedly when converting RESP serialized object to Lua object and it consumes extra cpu resources a bit when we need to transfer RESP-serialized data to Lua world. This patch try to remove this extra resize to reduce (re-)allocation overhead. | name | unstable bb57dfe (rps) | this patch(rps) | improvements | | --------------- | -------- | --------- | -------------- | | evalsha - hgetall h1 | 60565.68 | 64487.01 | 6.47% | | evalsha - hgetall h10 | 47023.41 | 50602.17 | 7.61% | | evalsha - hgetall h25 | 33572.82 | 37345.48 | 11.23% | | evalsha - hgetall h50 | 24206.63 | 25276.14 | 4.42% | | evalsha - hgetall h100 | 15068.87 | 15656.8 | 3.90% | | evalsha - hgetall h300 | 5948.56 | 6094.74 | 2.46% | Signed-off-by: Masahiro Ide <masahiro.ide@lycorp.co.jp> Co-authored-by: Masahiro Ide <masahiro.ide@lycorp.co.jp>
- Loading branch information