Re: [PATCH] templates: Reinstate unused version comparison functions w/ warning

2023-11-29 Thread Mathieu Desnoyers
se because they were now unused internally, without expecting this impact for external users. The gradual deprecation plan seems better indeed. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com ___ Grub-devel mailing list

Re: [PATCH v5 3/5] grub-mkconfig hurd: Fix quadratic algorithm for sorting menu items

2022-06-13 Thread Mathieu Desnoyers
- On Jun 11, 2022, at 7:55 PM, samuel thibault samuel.thiba...@ens-lyon.org wrote: > Hello, > > Mathieu Desnoyers, le jeu. 09 juin 2022 14:50:22 -0400, a ecrit: >> The current implementation of the 10_hurd script implements its menu >> items sorting in bash with

Re: [PATCH v5 2/5] grub-mkconfig linux_xen: Fix quadratic algorithm for sorting menu items

2022-06-13 Thread Mathieu Desnoyers
- On Jun 10, 2022, at 4:00 PM, Jason Andryuk jandr...@gmail.com wrote: > On Thu, Jun 9, 2022 at 2:50 PM Mathieu Desnoyers > wrote: >> >> The current implementation of the 20_linux_xen script implements its >> menu items sorting in bash with a quadratic algorithm,

[PATCH v6 3/5] grub-mkconfig hurd: Fix quadratic algorithm for sorting menu items

2022-06-13 Thread Mathieu Desnoyers
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. Signed-off-by: Mathieu Desnoyers Tested-by: Samuel Thibault Cc: Samuel Thibault --- Changes since v4: - Combine sed -e '...'

[PATCH v6 1/5] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-06-13 Thread Mathieu Desnoyers
Iterate on the reverse-sorted list to output each menu entry item. Therefore, the algorithm proposed has O(n*log(n)) complexity with GNU coreutils' sort compared to the prior O(n^2) complexity. Moreover, the constant time required for each list entry is much less because sorting is done within a

[PATCH v6 4/5] grub-mkconfig kfreebsd: Fix quadratic algorithm for sorting menu items

2022-06-13 Thread Mathieu Desnoyers
lopers 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 kfreebsd environment could test it before it is merged. ] Sign

[PATCH v6 2/5] grub-mkconfig linux_xen: Fix quadratic algorithm for sorting menu items

2022-06-13 Thread Mathieu Desnoyers
lopers 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. Signed-off-by: Mathieu Desnoyers Tested-by: Jason Andryuk Cc: xen-de...@lists.xenproject.org --- Changes since v4: - Combine sed -e '.

[PATCH v6 0/5] grub-mkconfig: Fix quadratic algorithm for sorting menu items

2022-06-13 Thread Mathieu Desnoyers
This series of patches fixes a O(n^2) algorithm in the menu items generation scripts. Since v5, add Tested-by tags, and update patch 1 to apply bash best practices. Testing is still needed on kfreebsd. Mathieu Mathieu Desnoyers (5): grub-mkconfig linux: Fix quadratic algorithm for sorting

[PATCH v6 5/5] Cleanup: grub-mkconfig_lib: remove unused version comparison functions

2022-06-13 Thread Mathieu Desnoyers
There are no users left of version_find_latest(), version_test_gt(), and version_test_numeric(). Remove those unused helper functions. Using those helper functions is what caused the quadratic sorting performance issues in the first place, so removing them is a net win. Signed-off-by: Mathieu

[PATCH v5 4/5] grub-mkconfig kfreebsd: Fix quadratic algorithm for sorting menu items

2022-06-09 Thread Mathieu Desnoyers
lopers 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 kfreebsd environment could test it before it is merged. ] Sign

[PATCH v5 2/5] grub-mkconfig linux_xen: Fix quadratic algorithm for sorting menu items

2022-06-09 Thread Mathieu Desnoyers
lopers 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. ] Sign

[PATCH v5 5/5] Cleanup: grub-mkconfig_lib: remove unused version comparison functions

2022-06-09 Thread Mathieu Desnoyers
There are no users left of version_find_latest(), version_test_gt(), and version_test_numeric(). Remove those unused helper functions. Using those helper functions is what caused the quadratic sorting performance issues in the first place, so removing them is a net win. Signed-off-by: Mathieu

[PATCH v5 1/5] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-06-09 Thread Mathieu Desnoyers
Iterate on the reverse-sorted list to output each menu entry item. Therefore, the algorithm proposed has O(n*log(n)) complexity with GNU coreutils' sort compared to the prior O(n^2) complexity. Moreover, the constant time required for each list entry is much less because sorting is done within a

[PATCH v5 3/5] grub-mkconfig hurd: Fix quadratic algorithm for sorting menu items

2022-06-09 Thread Mathieu Desnoyers
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 Hurd environment could test it before it is merged. ] Signed-off-by: Mathieu Des

[PATCH v5 0/5] grub-mkconfig: Fix quadratic algorithm for sorting menu items

2022-06-09 Thread Mathieu Desnoyers
This series of patches fixes a O(n^2) algorithm in the menu items generation scripts. Testing is still needed on linux_xen, hurd, and kfreebsd. Mathieu Mathieu Desnoyers (5): grub-mkconfig linux: Fix quadratic algorithm for sorting menu items grub-mkconfig linux_xen: Fix quadratic algorithm

Re: [RFC PATCH v3 5/5] Cleanup: grub-mkconfig_lib: remove unused version comparison functions

2022-05-30 Thread Mathieu Desnoyers
- On May 27, 2022, at 10:56 AM, Robbie Harwood rharw...@redhat.com wrote: > Michael Chang via Grub-devel writes: > >> On Thu, May 26, 2022 at 05:07:11PM -0400, Robbie Harwood wrote: >>> Mathieu Desnoyers writes: >>> >>>> There are no users left

Re: [RFC PATCH v3 1/5] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-05-26 Thread Mathieu Desnoyers
- On May 26, 2022, at 11:13 AM, Daniel Kiper dki...@net-space.pl wrote: > On Fri, May 20, 2022 at 10:37:37AM -0400, Mathieu Desnoyers wrote: >> The current implementation of the 10_linux script implements its menu >> items sorting in bash with a quadratic algorithm, calli

Re: [RFC PATCH v3 0/5] grub-mkconfig: Fix quadratic algorithm for sorting menu items

2022-05-20 Thread Mathieu Desnoyers
Sorry, the subject prefix for this patch series should have been [RFC PATCH v4 n/5]. - On May 20, 2022, at 10:37 AM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > This series of patches fixes a O(n^2) algorithm in the menu items > generation scripts. > > Test

[RFC PATCH v3 5/5] Cleanup: grub-mkconfig_lib: remove unused version comparison functions

2022-05-20 Thread Mathieu Desnoyers
There are no users left of version_find_latest(), version_test_gt(), and version_test_numeric(). Remove those unused helper functions. Using those helper functions is what caused the quadratic sorting performance issues in the first place, so removing them is a net win. Signed-off-by: Mathieu

[RFC PATCH v3 2/5] grub-mkconfig linux_xen: Fix quadratic algorithm for sorting menu items

2022-05-20 Thread Mathieu Desnoyers
lopers 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. ] Sign

[RFC PATCH v3 4/5] grub-mkconfig kfreebsd: Fix quadratic algorithm for sorting menu items

2022-05-20 Thread Mathieu Desnoyers
lopers 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 kfreebsd environment could test it before it is merged. ] Sign

[RFC PATCH v3 0/5] grub-mkconfig: Fix quadratic algorithm for sorting menu items

2022-05-20 Thread Mathieu Desnoyers
This series of patches fixes a O(n^2) algorithm in the menu items generation scripts. Testing is still needed on linux_xen, hurd, and kfreebsd. Mathieu Mathieu Desnoyers (5): grub-mkconfig linux: Fix quadratic algorithm for sorting menu items grub-mkconfig linux_xen: Fix quadratic algorithm

[RFC PATCH v3 3/5] grub-mkconfig hurd: Fix quadratic algorithm for sorting menu items

2022-05-20 Thread Mathieu Desnoyers
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 Hurd environment could test it before it is merged. ] Signed-off-by: Mathieu D

[RFC PATCH v3 1/5] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-05-20 Thread Mathieu Desnoyers
Iterate on the reverse-sorted list to output each menu entry item. Therefore, the algorithm proposed has O(n*log(n)) complexity with GNU coreutils' sort compared to the prior O(n^2) complexity. Moreover, the constant time required for each list entry is much less because sorting is done within

Re: [PATCH v3] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-05-20 Thread Mathieu Desnoyers
- On May 20, 2022, at 7:01 AM, Daniel Kiper dki...@net-space.pl wrote: > On Thu, May 19, 2022 at 04:52:54PM -0400, Mathieu Desnoyers wrote: >> - On May 19, 2022, at 2:36 PM, Daniel Kiper dki...@net-space.pl wrote: >> [...] >> > >> > Could you do the sa

Re: [PATCH v3] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-05-19 Thread Mathieu Desnoyers
me 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 ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel

Re: [PATCH v3] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-05-19 Thread Mathieu Desnoyers
- On May 5, 2022, at 7:02 PM, Oskari Pirhonen xxc3ncore...@gmail.com wrote: > On Thu, May 05, 2022 at 10:24:56AM -0400, Mathieu Desnoyers wrote: [...] > > Instead of creating a separate function, would it be better to let > `version_sort()` accept an argument/set

Re: [PATCH] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-05-19 Thread Mathieu Desnoyers
- On May 3, 2022, at 1:15 PM, Mihai Moldovan io...@ionic.de wrote: > Just a nit, feel free to ignore it... > > > * On 5/3/22 4:42 PM, Mathieu Desnoyers wrote: >> How does the following paragraph sound ? >> >> >> Here is the improved algorithm pr

[PATCH v3] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-05-05 Thread Mathieu Desnoyers
ed(1), sort(1), head(1), and grep(1) in sub-shells. I notice that the same quadratic sorting is done for other supported OSes, so I suspect similar gains can be obtained there, but I limit the scope of this patch to Linux because this is the platform on which I can test. Signed-off-by: Mathieu De

Re: [PATCH v2] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-05-05 Thread Mathieu Desnoyers
- On May 5, 2022, at 9:53 AM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On May 4, 2022, at 11:24 AM, Mathieu Desnoyers > mathieu.desnoy...@efficios.com wrote: > >> - On May 4, 2022, at 10:43 AM, Robbie Harwood rharw...@redhat.com wrote: >>

Re: [PATCH v2] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-05-05 Thread Mathieu Desnoyers
- On May 4, 2022, at 11:24 AM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On May 4, 2022, at 10:43 AM, Robbie Harwood rharw...@redhat.com wrote: > >> Mathieu Desnoyers writes: >> >>> +version_reverse_sort () >>> +{ >>>

Re: [PATCH v2] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-05-04 Thread Mathieu Desnoyers
- On May 4, 2022, at 10:43 AM, Robbie Harwood rharw...@redhat.com wrote: > Mathieu Desnoyers writes: > >> +version_reverse_sort () >> +{ >> + case $version_reverse_sort_sort_has_v in > > Does this need to be its own variable, or could it just reuse > vers

[PATCH v2] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-05-03 Thread Mathieu Desnoyers
, and grep(1) in sub-shells. I notice that the same quadratic sorting is done for other supported OSes, so I suspect similar gains can be obtained there, but I limit the scope of this patch to Linux because this is the platform on which I can test. Signed-off-by: Mathieu Desnoyers --- Changes

Re: [PATCH] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-05-03 Thread Mathieu Desnoyers
- On May 3, 2022, at 4:47 AM, Paul Menzel pmen...@molgen.mpg.de wrote: > Dear Mathieu, > > > Am 02.05.22 um 16:14 schrieb Mathieu Desnoyers: >> The current implementation of the 10_linux script implements its menu >> items sorting in bash with a quadratic algorit

[PATCH] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-05-02 Thread Mathieu Desnoyers
suspect similar gains can be obtained there, but I limit the scope of this patch to Linux because this is the platform on which I can test. Signed-off-by: Mathieu Desnoyers --- util/grub-mkconfig_lib.in | 18 ++ util/grub.d/10_linux.in | 12 2 files changed, 26 inse

[RFC PATCH] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-04-29 Thread Mathieu Desnoyers
imilar gains can be obtained there, but I limit the scope of this patch to Linux because this is the platform on which I can test. Signed-off-by: Mathieu Desnoyers --- util/grub-mkconfig_lib.in | 18 ++ util/grub.d/10_linux.in | 12 2 files changed, 26 insertions(+),