[Tarantool-patches] [PATCH 00/20] Rewrite performance critical parts of net.box in C

Vladimir Davydov vdavydov at tarantool.org
Wed Aug 4 15:40:56 MSK 2021

On Wed, Aug 04, 2021 at 01:05:37AM +0200, Vladislav Shpilevoy wrote:
> Did you try to port netbox to direct usage of ev_io instead of a dedicated
> fiber + coio_wait wrapper? Do you think it is worth trying? The only problem
> I see is the necessity to call on_connect/on_disconnect/on_schema_reload/...
> triggers somewhere but the scheduler fiber, because they are allowed to yield.
> The pros is that you won't call ev_io_start/ev_io_stop on each 'communicate'
> iteration. AFAIR, on Linux they lead to epoll_ctl() to add/remove a descriptor
> from epoll, and these calls are expensive.
> At that point the netbox state machine does not seem to be doing much in Lua.
> Even if you keep the fiber, it could be ported to C entirely. It is now only
> 270 lines including empty lines and comments.

No, I haven't tried or even planned to do that, but I agree it might
improve overall net.box performance - at the very least it will reduce
the number of Lua function calls, because perform_async_request and
perform_request will be called directly, without Lua wrappers. Still,
this doesn't block this series and we can easily do it on top. I opened
a ticket so that we don't forget:


More information about the Tarantool-patches mailing list