[Tarantool-patches] [PATCH] net.box: allow to store user-defined fields in future object
Igor Munkin
imun at tarantool.org
Thu Aug 12 21:13:56 MSK 2021
Vova,
Thanks for the patch! I am curious why Lua tables are not chosen for
storing users data? It looks more natural (kinda netbox request storage
that would be similar to the fiber's one), and easier to implement. Of
course the only thing bothering me about Lua tables usage is Lua GC
pressure. However:
* Whether there are *too* much entries, TABOV might occur for REGISTRY
table and keeping many tables (especially short living ones) at once
is also not such good option.
* In case there are *just* much entries, I perhaps that REGISTRY
performance is better that spawning lots of tables. Anyway, I haven't
look on the mhash implementation, so I have no estimations about its
perfomance. I see they are created and destroyed manually, but Lua
tables are within the GC reign, so some time is spent on their
traversal. At the same time, REGISTRY traversal is atomic, so
inflating it also affects the time spent on a particular incremental
GC step. Too much theory, BTW. Benchmarks are required for this case.
* If this is more an exceptional option (that's I doubt considering
Yaroslav complains regarding this functionality breakage), then any of
the option is fine IMHO, so the most convenient is preferable.
It would be great to see the comparison for your current implementation
and the one using Lua tables. The most interesting workload is a bunch
of short-term requests, I guess.
--
Best regards,
IM
More information about the Tarantool-patches
mailing list