[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Mathieu Desnoyers
Subject: Re: [PATCH v3] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items
Date: Thu, 19 May 2022 16:52:54 -0400 (EDT)

----- On May 19, 2022, at 2:36 PM, Daniel Kiper wrote:
> Could you do the same in util/grub.d/ Both should be
> kept in sync. And you are not first one who updates only.
> If you could make a patch which adds something like "Keep logic in sync
> with..." to the util/grub.d/ and util/grub.d/
> that would be perfect.

AFAIU, does:

while [ "x${xen_list}" != "x" ] ; do
    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' ' '`
    if [ x"$is_top_level" != xtrue ]; then
        echo '  }'
    xen_list=`echo $xen_list | tr ' ' '\n' | fgrep -vx "$current_xen" | tr '\n' 
' '`

Which adds yet another loop iterating on each item of "xen_list". For each of 
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 and 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 
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.



> Daniel

Mathieu Desnoyers
EfficiOS Inc.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]