From owner-dev-commits-src-main@freebsd.org Mon Jun 14 12:28:59 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18712660B53; Mon, 14 Jun 2021 12:28:59 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G3W2y75M7z4pHV; Mon, 14 Jun 2021 12:28:58 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-lj1-f179.google.com with SMTP id d13so7782104ljg.12; Mon, 14 Jun 2021 05:28:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+FuAAWbkyjdqT++HSk7C/MYtZRONSogmYxYXs0dZKHg=; b=HX5ckOLFr8878ZKC9HvZw+9nWu+W6lMIsweAdVeeWNtuotHdiAYSRtCOidnY4NL1KX kmkRSqVGY4Oi4l0fhHp7rH6fW1zJ6VB/2kQHHGrMaIs6Rtm5Z5R5BO4YI1a7afIwBdUc PX+GBT8PZAPY8tuNRIHafDvnkiSA2AtJmUNshPp7HQj0mGAyqzKgmoh0lRavOOpoyKRf B6C87LSRYKBJE5QaFzhl52wKkqWzRyIQNX1B9tEcN2v5FILsOy+YbDACENWqUCvEGEXF oJJ96ZFhiDJyPZdkT3nm71ZdM5MUXbcH0V2Jk80QxR+fx2Z6h7diQboPimEVb5+t38ay CkIg== X-Gm-Message-State: AOAM533HMTDmeKiVczwqgkcN9MQRQgyP0a66wd8MrWXWcyUM04yus+WC xuz/jcsrQfifk9rSy61n+VTNLjVcD6DLjMw0Px/DDDukWVbRpQ== X-Google-Smtp-Source: ABdhPJwSU6GNYVzMnOW08scKcLDCtSpi/GJTfIDTTpCk+uRjTevVhM6OVhKqwKhuNcJjKNYj8PQk2PsWG1Yb/Dt2Jsc= X-Received: by 2002:a2e:a3ce:: with SMTP id w14mr13409776lje.451.1623673737305; Mon, 14 Jun 2021 05:28:57 -0700 (PDT) MIME-Version: 1.0 References: <202106111551.15BFpp8j055403@gitrepo.freebsd.org> <4EF64072-D94B-46FB-9AE9-321936DEEA7C@sigsegv.be> In-Reply-To: <4EF64072-D94B-46FB-9AE9-321936DEEA7C@sigsegv.be> From: Mariusz Zaborski Date: Mon, 14 Jun 2021 14:28:46 +0200 Message-ID: Subject: Re: git: 89d5cbb82294 - main - libnv: optimize nvlist size calculation To: Kristof Provost Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4G3W2y75M7z4pHV X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2021 12:28:59 -0000 No, I will do this till end of the week. Thanks, Mariusz On Mon, 14 Jun 2021 at 14:10, Kristof Provost wrote: > On 11 Jun 2021, at 17:51, Mariusz Zaborski wrote: > > The branch main has been updated by oshogbo: > > > > URL: > > > https://cgit.FreeBSD.org/src/commit/?id=89d5cbb82294c8624e66f920d50353057ccab14b > > > > commit 89d5cbb82294c8624e66f920d50353057ccab14b > > Author: Mariusz Zaborski > > AuthorDate: 2021-06-11 15:35:36 +0000 > > Commit: Mariusz Zaborski > > CommitDate: 2021-06-11 15:51:29 +0000 > > > > libnv: optimize nvlist size calculation > > > > If we had a multiple nvlist, during nvlist_pack, we calculated the > > size > > of every nvlist separately. For example, if we had a nvlist with > > three > > nodes each containing another (A contains B, and B contains C), we > > first > > calculated the size of nvlist A (which contains B, C), then we > > calculate > > the size of B (which contains C, notice that we already did the > > calculation of B, when we calculate A), and finally C. This means > > that > > this calculation was O(N!). This was done because each time we > > pack > > nvlist, we have to put its size in the header > > (the separate header for A, B, and C). > > > > To not break the ABI and to reduce the complexity of nvlist_size, > > instead of calculating the nvlist size when requested, > > we track the size of each nvlist. > > > > Reported by: pjd, kp > > Tested by: kp > > Thanks for this! > > Do you object to this being MFCd in a few days? > > Thanks, > Kristof >