From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nrn9B-0002n1-1N for mharc-grub-devel@gnu.org; Thu, 19 May 2022 16:53:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrn97-0002mm-QB for grub-devel@gnu.org; Thu, 19 May 2022 16:53:22 -0400 Received: from mail.efficios.com ([167.114.26.124]:47168) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrn95-0002yo-Me for grub-devel@gnu.org; Thu, 19 May 2022 16:53:21 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id BAA993FF920; Thu, 19 May 2022 16:52:55 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id NcU1NQXaTYkD; Thu, 19 May 2022 16:52:55 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 054803FFA80; Thu, 19 May 2022 16:52:55 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 054803FFA80 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1652993575; bh=hRqX/1/zvmLhDc2X4UqVc+aPrmBFF5pp8gmXx9RROoI=; h=Date:From:To:Message-ID:MIME-Version; b=g5knJmGbcjvpn1wHQVog3IMOM1Dngx3Pvl4ZBvR4Xto2SUHgY6BhpNgDzi/gKHqlc j4roRhjhNWq7UqPflM9uSLS4DDJ7BlhHnXuY3vQp+my8UJHPPwpLXeDoiij84UkX3G fN1rkiALC5/w5c7anbpKqxkIFBlmTI3LEjQXUeXqn8Ye4J4JBjbRANPqkntavsVwnf WAIzjCP7MoBIEFx7FYJrVvwLRnSbX4buKWQ+RUeiAhHd/l3u/yZ4kG7Ss59SBcPk0E eS1izUVxL9bLWA2xphwD43GvHq4+XNmLpwN0hji+7/GjRBttVwqpHQtzLx6m3ALEsh sEtxTy8VOfVQA== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id KOLUblrz7p4u; Thu, 19 May 2022 16:52:54 -0400 (EDT) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id EAE303FF8B9; Thu, 19 May 2022 16:52:54 -0400 (EDT) Date: Thu, 19 May 2022 16:52:54 -0400 (EDT) From: Mathieu Desnoyers To: Daniel Kiper Cc: Daniel Kiper , Vladimir phcoder Serbinenko , grub-devel , Paul Menzel , Robbie Harwood Message-ID: <1711366171.63066.1652993574862.JavaMail.zimbra@efficios.com> In-Reply-To: <20220519183603.i2i4qz67ume3eagd@tomti.i.net-space.pl> References: <20220505142456.58107-1-mathieu.desnoyers@efficios.com> <20220519183603.i2i4qz67ume3eagd@tomti.i.net-space.pl> Subject: Re: [PATCH v3] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_4257 (ZimbraWebClient - FF100 (Linux)/8.8.15_GA_4257) Thread-Topic: grub-mkconfig linux: Fix quadratic algorithm for sorting menu items Thread-Index: TAZRmOsVfe8cuiau+pp6MBSxywuNzA== Received-SPF: pass client-ip=167.114.26.124; envelope-from=compudj@efficios.com; helo=mail.efficios.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2022 20:53:22 -0000 ----- On May 19, 2022, at 2:36 PM, Daniel Kiper dkiper@net-space.pl wrote: [...] > > Could you do the same in util/grub.d/20_linux_xen.in? Both should be > kept in sync. And you are not first one who updates 10_linux.in only. > If you could make a patch which adds something like "Keep logic in sync > with..." to the util/grub.d/10_linux.in and util/grub.d/20_linux_xen.in > that would be perfect. AFAIU, 20_linux_xen.in does: while [ "x${xen_list}" != "x" ] ; do list="${linux_list}" current_xen=`version_find_latest $xen_list` [....] while [ "x$list" != "x" ] ; do linux=`version_find_latest $list` [...] list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '` done if [ x"$is_top_level" != xtrue ]; then echo ' }' fi xen_list=`echo $xen_list | tr ' ' '\n' | fgrep -vx "$current_xen" | tr '\n' ' '` done Which adds yet another loop iterating on each item of "xen_list". For each of those, there is an iteration on "linux_list". I can do the change, like I can do the change for other OSes, but I don't have the environment to test those changes. Would you be OK if I submit an untested patch for someone else to try out ? I notice that 10_hurd.in and 10_kfreebsd.in also have the exact same inefficient pattern. Would you be OK if I also change them and let the change be tested by those who have those environments ? > > Did you consider Oskari's comment sent in the other email? I just did, sorry for the delay, I missed his email because it was only sent to the list. Thanks, Mathieu > > Daniel -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com