bug-gnulib
[Top][All Lists]
Advanced

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

Re: gnulib-tool.py: Optimize module set lookups


From: Collin Funk
Subject: Re: gnulib-tool.py: Optimize module set lookups
Date: Thu, 11 Apr 2024 13:03:45 -0700
User-agent: Mozilla Thunderbird

Hi Bruno,

On 4/11/24 12:51 PM, Bruno Haible wrote:
> The func_transitive_closure function in the shell implementation can take
> a lot of time. So I wondered whether in the Python implementation, there
> is room for speedup at this place as well. And indeed, there is.

Nice work. I noticed this too, which was my reasoning for wanting to
change GLModuleSystem to use sets to store the modules instead of
lists.

Doing so would break the sorting required for the test cases though.
All modules are sorted except for the dummy module which is placed at
the end.

I ended up just changing the avoided modules since it was easy and
every module + it's dependencies are checked:

        while inmodules:
            inmodules_this_round = inmodules
            inmodules = []               # Accumulator, queue for next round
            for module in inmodules_this_round:
                if module not in self.avoids:  # Important line here.
                    outmodules.append(module)

Collin



reply via email to

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