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 211C070202; Wed, 24 Feb 2021 01:30:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 211C070202 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1614119451; bh=HRRt9Ul1KzHrHicQs3dXRlAt4EBkMIlIoWIf9bB9n3o=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=nmWH+z3sVb4QKwbT00JpBWSKrit11dBRCswQWxRWu2iP4ejhzHPiLq3hPEacG/IU9 rjWMsqXD5uInmIvWyNso2JCf+ei3ixD4fuLqddZSL9cvIw71LGPUFlaBewGJDxCA97 RJ5LZ344Bnjbx/kb0pQLf9hNZkJSK5j/+ioaV7kQ= Received: from smtp46.i.mail.ru (smtp46.i.mail.ru [94.100.177.106]) (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 277AE70202 for ; Wed, 24 Feb 2021 01:30:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 277AE70202 Received: by smtp46.i.mail.ru with esmtpa (envelope-from ) id 1lEgCe-00083C-Ft; Wed, 24 Feb 2021 01:30:48 +0300 To: Serge Petrenko , gorcunov@gmail.com Cc: tarantool-patches@dev.tarantool.org References: <20210212112541.27561-1-sergepetrenko@tarantool.org> <57b04874-1bb7-3d62-856d-b60df700514a@tarantool.org> <774363df-6be5-a7b4-ea7f-d72903f3c409@tarantool.org> Message-ID: Date: Tue, 23 Feb 2021 23:30:47 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <774363df-6be5-a7b4-ea7f-d72903f3c409@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD975C3EC174F56692243410BA6471F01664CBE9F2A03BCE963182A05F538085040FAC98AE79451E55405F9CD962E32BA187FEBD1D227AFAEEFC8B3D5D5D8659632 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE72847AA60176ABEF3EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006374FA524FBD8B89EAA8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC61D9FADA98E6539AB12E09D20A5052008EC19EA584375925389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0D9442B0B5983000E8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6F459A8243F1D1D44CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C224960A4683F2194B8D276E601842F6C81A12EF20D2F80756B5F7E9C4E3C761E06A776E601842F6C81A127C277FBC8AE2E8B0CC1AEF8721A2C753AA81AA40904B5D9DBF02ECDB25306B2B25CBF701D1BE8734AD6D5ED66289B5278DA827A17800CE72F88032165008D5167F23339F89546C5A8DF7F3B2552694A6FED454B719173D6725E5C173C3A84C3E2C51E5CF308F7B035872C767BF85DA2F004C906525384306FED454B719173D6462275124DF8B9C9AE7E30DF62CE24E4E5BFE6E7EFDEDCD789D4C264860C145E X-C1DE0DAB: 0D63561A33F958A56BD9CEBF4EDCFF88DF76C8B0C5851552963E10557ADC7B54D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7557E988E9157162368E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A9873270276D43348DE34D9333BF32085FAAC65E2CE260C4B519AE502797FDF6902FE227E36F100F1D7E09C32AA3244CAF8D266134FD959B19EF42E440A72DC2BBA718C7E6A9E042FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojyK6JYJ15DtIAgRg/kEiHXA== X-Mailru-Sender: 504CC1E875BF3E7D9BC0E5172ADA3110B4D79360615CA08F5E8DED6088A6504CEF1968EC484199D107784C02288277CA03E0582D3806FB6A5317862B1921BA260ED6CFD6382C13A6112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH] relay: yield explicitly every N sent rows 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Thanks for the patch! >>> diff --git a/src/box/relay.cc b/src/box/relay.cc >>> index 1d8edf116..6d9269e1d 100644 >>> --- a/src/box/relay.cc >>> +++ b/src/box/relay.cc >>> @@ -117,6 +117,11 @@ struct relay { >>>           * is passed by the replica on subscribe. >>>           */ >>>          uint32_t id_filter; >>> +       /** >>> +        * How many rows has this relay sent to the replica. Used to yield once >>> +        * in a while when reading a WAL to unblock the event loop. >>> +        */ >>> +       size_t row_cnt; Name is a bit ugly, because all the other members are not contractions. They use full words. But up to you. >> 1. But it is not a size of anything, right? Maybe make it >> int64_t then? > > uint64_t, probably? Nope, int64_t. It is supposed to be 'faster'. Because it does not have defined overflow rules, and therefore the hardware does not need to handle it. But honestly, I didn't measure. For me it is more cargo cult. I just use signed integers where I can assuming that the hardware really may omit an instruction or so. Up to you. The patch about power of 2 worked btw. This is how it looks now: andq $0x7fff, %rcx ; imm = 0x7FFF this is how it used to look: movl $0x7d00, %ecx ; imm = 0x7D00 divq %rcx