From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 424E16EC43; Wed, 11 Aug 2021 23:33:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 424E16EC43 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1628714015; bh=obhW/tjY4/1Asz4kRvvFuXi/jsDogLJZX/waDoie3KY=; h=To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=yMo/oUOt1TEzFi7Hd19FvpMdtTOa3q9UVuhKn5Fcce/HUePQXl6nZ2q8Zauu3VUpM LySis8OeKMRHVzplcImLCVoPJldWBtvwTlnDYEUReF42AYEFFPRW12VMIxX3yX1P7s OJdn0319gqGP5iiXdK2k0srLdKZc4cIpXAbn+TV4= Received: from smtp30.i.mail.ru (smtp30.i.mail.ru [94.100.177.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 2719B6EC40 for ; Wed, 11 Aug 2021 23:33:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2719B6EC40 Received: by smtp30.i.mail.ru with esmtpa (envelope-from ) id 1mDuuq-0007H4-AN; Wed, 11 Aug 2021 23:33:32 +0300 To: v.shpilevoy@tarantool.org, imun@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Wed, 11 Aug 2021 23:33:27 +0300 Message-Id: X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD906AB4890CDABF0C5CB76CEE71D3E4007182A05F538085040BE485F64E8BE399327876320AABFA37D9DCDD911CA5C4706254FA34163E98C41 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7370F4F695FFFC24BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006371DF52D98DC3592C48638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D84136241214EABB222667C65BD3347C69117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC3A703B70628EAD7BA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751F6FD1C55BDD38FC3FD2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EED76C6ED7039589DEC3123C4324A5CF10D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE362B3BD3CC35DA588040F9FF01DFDA4A8C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637E62180BDA7F10F15EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458834459D11680B50593F9751AE8244DFDE3FF1EB4E68698B2 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C6B668463F4F89F86CD9E40DD40F4128EBE55C3A6C4F193539C2B6934AE262D3EE7EAB7254005DCEDDA6A3A903E88C08C1E0A4E2319210D9B64D260DF9561598F01A9E91200F654B0AEA200A0D3D80EA68E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34D4E96E2A5B1100E04C3AFE6F230C3E1D081FC9470D4B538FC5A8C35BF97E12C906E7FFA4326E43371D7E09C32AA3244C95860466F561C446745B1CB9F5A62DD469B6CAE0477E908DFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXhA5ivuNF1pr940rns+bP8j X-Mailru-Sender: 583F1D7ACE8F49BD1042885CEC987B6B8D49A1454053B4D027876320AABFA37DB9A8FEFFB5F7F2D57019711D9D5B048E1458020726E2BC9FD5ECBA0B92C0A936CDC7563AA7CEBD287402F9BA4338D657ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH 0/4] fiber: keep reference to userdata if fiber created once X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Oleg Babin via Tarantool-patches Reply-To: olegrok@tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" From: Oleg Babin This patch reworks approach to fiber management in Lua. Before this patch each action that should return fiber led to new userdata creation that was quite slow and made GC suffer. This patch introduces new field in struct fiber to store a reference to userdata that was created once for a fiber. It allows speedup operations as fiber.self() and fiber.id(). Simple benchmark shows that access to fiber storage is faster in two times, fiber.find() - 2-3 times and fiber.new/create functions don't have any changes. Initially changes were inspired by #6210 [1] but current patchset doesn't introduce anything new just improves performance of existing functions. Some results are available also in related github PR [2]. [1] https://github.com/tarantool/tarantool/issues/6210 [2] https://github.com/tarantool/tarantool/pull/6280 Oleg Babin (4): fiber: rename ref to fiber_ref fiber: pass struct fiber into lbox_pushfiber instead of id fiber: keep reference to userdata if fiber created once fiber: allocate on_stop triggers using mempool src/lib/core/fiber.h | 7 ++- src/lua/fiber.c | 134 ++++++++++++++++++------------------------- 2 files changed, 62 insertions(+), 79 deletions(-) -- 2.32.0