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 2F0A427AF2 for ; Thu, 14 Feb 2019 05:31:17 -0500 (EST) 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 aOcRGlt5h_YA for ; Thu, 14 Feb 2019 05:31:17 -0500 (EST) Received: from smtp57.i.mail.ru (smtp57.i.mail.ru [217.69.128.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id D116327AD1 for ; Thu, 14 Feb 2019 05:31:16 -0500 (EST) Date: Thu, 14 Feb 2019 13:31:14 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH v2 2/2] Track wal vclock changes instead of copying Message-ID: <20190214103114.GC30749@chai> References: <9b0d551519dd24f3c456fc28e512e26e953275fc.1550046797.git.georgy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9b0d551519dd24f3c456fc28e512e26e953275fc.1550046797.git.georgy@tarantool.org> 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: tarantool-patches@freelists.org Cc: Georgy Kirichenko * Georgy Kirichenko [19/02/13 11:54]: > Spare some vclock_copy invocations because they could be expensive. OK to push. > +static inline void > +vclock_merge(struct vclock *dst, struct vclock *diff) > +{ > + struct vclock_iterator it; > + vclock_iterator_init(&it, diff); > + vclock_foreach(&it, item) > + vclock_follow(dst, item.id, vclock_get(dst, item.id) + item.lsn); > + vclock_create(diff); > +} I agree with the approach since in most cases you're going to have just one component in vclock_diff, so this approach is not going to depend on the size of vclock (VCLOCK_MAX). Thank you for following up on this. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov