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 C320C6EC40; Wed, 18 Aug 2021 16:38:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C320C6EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1629293915; bh=Wh3SZQAI45EuXx3ea1WmHw5v/T4TcTu6Vo0Uwcvx3cM=; 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=IFVvNv9I6NBgNqO1yJMab2D4KSB07FjOwh9Xtm56pmrNg1kLEHsGZUgozliqhCRzp kp5tdBE+y8AbO0067kJ9mpJr6dtTKCdDIZHQR9UkoYUYQjBtIBLmFOcsC2t1Y64tDB XJr7MCfUzk9Jcru3i32MkXxP897012AUDBhadpIA= Received: from smtp33.i.mail.ru (smtp33.i.mail.ru [94.100.177.93]) (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 BEBC86EC40 for ; Wed, 18 Aug 2021 16:38:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BEBC86EC40 Received: by smtp33.i.mail.ru with esmtpa (envelope-from ) id 1mGLm4-0005So-R7; Wed, 18 Aug 2021 16:38:33 +0300 To: Vladimir Davydov , Timur Safin via Tarantool-patches Cc: v.shpilevoy@tarantool.org References: <20210817165243.kumsj3x2ia5pijme@esperanza> <20210817191633.jkkadgpwe3imkbas@esperanza> Message-ID: <9dc4684e-c7a3-c300-c677-c35b1f8aeee5@tarantool.org> Date: Wed, 18 Aug 2021 16:38:20 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210817191633.jkkadgpwe3imkbas@esperanza> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD9D5AC6413C25DCF08CC98B8FCC5CD86F3182A05F5380850402EDA38ED178CB61C71283397133E2259A4345DE50ED5B1E3CD3BDF68C17D0671 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A3DED2DACB82E709C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7A8325FA649D0A450EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BBCA57AF85F7723F20A76C27868D8CB034D6D4BC7E9DD446ECC7F00164DA146DAFE8445B8C89999728AA50765F7900637D0FEED2715E18529389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC85FF72824B19451C6F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C223C850C94764309BA3038C0950A5D36C8A9BA7A39EFB766EC990983EF5C0329BA3038C0950A5D36D5E8D9A59859A8B6EF91E2CE43C37A3076E601842F6C81A1F004C906525384307823802FF610243DF43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7CC415C329B279CF9D43847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A5BB32A98D75B9C22ED99FC858E3094A2BCE9DCF16798026D9D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA757E10A58996CBD514410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A1AF43396E40A36FA34F11E0D578E643FC61896B04139E29C12A2B1943C356E4F0B1139D140329E21D7E09C32AA3244C99081C357E22E3EE5E3EBE36D30C6391F94338140B71B8EEFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojuRQ/H5n28tqSwwfGix/AvA== X-Mailru-Sender: 6CA451E36783D721CBEA96CEA26D325D3FE8849335ADD3F7CF7D46425A5FE57CB7CBEF92542CD7C82F97C478340294DCC77752E0C033A69E0F0C7111264B8915FF1320A92A5534336C18EFA0BB12DBB0 X-Mras: Ok X-PR7D5YW: 405e073cc6 Subject: Re: [Tarantool-patches] [PATCH v5 2/8] lua: built-in module datetime 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: Safin Timur via Tarantool-patches Reply-To: Safin Timur Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On 17.08.2021 22:16, Vladimir Davydov via Tarantool-patches wrote: > On Tue, Aug 17, 2021 at 07:52:43PM +0300, Vladimir Davydov wrote: >> On Mon, Aug 16, 2021 at 02:59:36AM +0300, Timur Safin via > Tarantool-patches wrote: >>> +/** >>> + * Full datetime structure representing moments >>> + * since Unix Epoch (1970-01-01). >>> + * Time is kept normalized to UTC, time-zone offset >>> + * is informative only. >>> + */ >>> +struct datetime { >>> + /** seconds since epoch */ >>> + double secs; >> >> Please add a comment explaining why you use 'double' instead of >> an integer type. > > Come to think of it, why don't you use two ints here? E.g. one for low > 32 bits, another for high 32 bits, or one for years, another for seconds > in the year. > This IMHO is awkward, and would scream of using int64_t. Especially if we would need to proceed this bit arithmetics in Lua. May play with that idea on the subsequent patches, but do not see any performance reason to do at the moment. Once again - apparently double is perfectly ok from performance point of view, and in our date range we want it to work with seconds it's not loosing any data. Looks like good enough. Thanks, Timur