[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 2/5] grub-mkconfig linux_xen: Fix quadratic algorithm for
From: |
Mathieu Desnoyers |
Subject: |
Re: [PATCH v5 2/5] grub-mkconfig linux_xen: Fix quadratic algorithm for sorting menu items |
Date: |
Mon, 13 Jun 2022 10:00:08 -0400 (EDT) |
----- On Jun 10, 2022, at 4:00 PM, Jason Andryuk jandryuk@gmail.com wrote:
> On Thu, Jun 9, 2022 at 2:50 PM Mathieu Desnoyers
> <mathieu.desnoyers@efficios.com> wrote:
>>
>> The current implementation of the 20_linux_xen script implements its
>> menu items sorting in bash with a quadratic algorithm, calling "sed",
>> "sort", "head", and "grep" to compare versions between individual lines,
>> which is annoyingly slow for kernel developers who can easily end up
>> with 50-100 kernels in their boot partition.
>>
>> This fix is ported from the 10_linux script, which has a similar
>> quadratic code pattern.
>>
>> [ Note: this is untested. I would be grateful if anyone with a Xen
>> environment could test it before it is merged. ]
>
> Hi, Mathieu,
>
> I tested by manually applying patch 2/5 on top of Fedora 36's
> installed /etc/grub.d/20_linux_xen, and manually applying patch 1/5 to
> /usr/share/grub/grub-mkconfig_lib. It seems to generate grub.cfg
> menuentry-ies in the correct order.
Noted. Added your Tested-by to patch 2/5. Thanks!
>
> Note for patch 1/5, it's best practice to use "$@" with the double
> quotes to prevent word splitting of arguments. Doesn't really matter
> for that function at this time though.
I'll update patch 1/5 with this change. It's best practice indeed. I notice
that there are quite a few other places in grub-mkconfig_lib.in that do
follow this best practice though.
Thanks,
Mathieu
>
> Regards,
> Jason
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
- [PATCH v5 0/5] grub-mkconfig: Fix quadratic algorithm for sorting menu items, Mathieu Desnoyers, 2022/06/09
- [PATCH v5 2/5] grub-mkconfig linux_xen: Fix quadratic algorithm for sorting menu items, Mathieu Desnoyers, 2022/06/09
- [PATCH v5 3/5] grub-mkconfig hurd: Fix quadratic algorithm for sorting menu items, Mathieu Desnoyers, 2022/06/09
- [PATCH v5 4/5] grub-mkconfig kfreebsd: Fix quadratic algorithm for sorting menu items, Mathieu Desnoyers, 2022/06/09
- [PATCH v5 5/5] Cleanup: grub-mkconfig_lib: remove unused version comparison functions, Mathieu Desnoyers, 2022/06/09
- [PATCH v5 1/5] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items, Mathieu Desnoyers, 2022/06/09