Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: tml <tarantool-patches@freelists.org>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Subject: [tarantool-patches] [PATCH] fiber: Drop redundant memset call
Date: Fri, 12 Apr 2019 11:03:19 +0300	[thread overview]
Message-ID: <20190412080319.27836-1-gorcunov@gmail.com> (raw)

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);
 
-- 
2.20.1

             reply	other threads:[~2019-04-12  8:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12  8:03 Cyrill Gorcunov [this message]
2019-04-12 14:08 ` Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190412080319.27836-1-gorcunov@gmail.com \
    --to=gorcunov@gmail.com \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH] fiber: Drop redundant memset call' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox