From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 3BD4E246C5 for ; Fri, 12 Apr 2019 04:03:49 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rffWGrO1Zpqp for ; Fri, 12 Apr 2019 04:03:49 -0400 (EDT) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id DEB6A22C2C for ; Fri, 12 Apr 2019 04:03:48 -0400 (EDT) Received: by mail-lj1-f177.google.com with SMTP id k8so7988000lja.8 for ; Fri, 12 Apr 2019 01:03:48 -0700 (PDT) From: Cyrill Gorcunov Subject: [tarantool-patches] [PATCH] fiber: Drop redundant memset call Date: Fri, 12 Apr 2019 11:03:19 +0300 Message-Id: <20190412080319.27836-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tml Cc: Cyrill Gorcunov 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