From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 12 Apr 2019 17:08:05 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] [PATCH] fiber: Drop redundant memset call Message-ID: <20190412140805.dvinwlipu4ob2ab5@esperanza> References: <20190412080319.27836-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190412080319.27836-1-gorcunov@gmail.com> To: Cyrill Gorcunov Cc: tml List-ID: On Fri, Apr 12, 2019 at 11:03:19AM +0300, Cyrill Gorcunov wrote: > When we allocate new fiber we are clearing the whole > structure right after, so no need to call memset again, > coro context is already full of zeros. > > Note the coro context is close to 1K size and redundat > memset here is really a penalty. > --- > src/lib/core/fiber.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/src/lib/core/fiber.c b/src/lib/core/fiber.c > index 38a3df511..283a53d58 100644 > --- a/src/lib/core/fiber.c > +++ b/src/lib/core/fiber.c > @@ -959,7 +959,6 @@ fiber_new_ex(const char *name, const struct fiber_attr *fiber_attr, > mempool_free(&cord->fiber_mempool, fiber); > return NULL; > } > - memset(&fiber->ctx, 0, sizeof(fiber->ctx)); > coro_create(&fiber->ctx, fiber_loop, NULL, > fiber->stack, fiber->stack_size); > Pushed to master.