[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnulib-tool.py: Fix 'consider-using-with' pylint warnings.
From: |
Collin Funk |
Subject: |
Re: gnulib-tool.py: Fix 'consider-using-with' pylint warnings. |
Date: |
Fri, 5 Apr 2024 15:13:31 -0700 |
User-agent: |
Mozilla Thunderbird |
Hi Bruno,
On 4/5/24 5:58 AM, Bruno Haible wrote:
> Sure. It was a translation of the shell code:
Ah, yeah that makes sense.
> Finding the maximum of a list directly is O(N). Finding it by sorting
> the list is O(N log N). Therefore it is clear which of the two should
> be preferred :)
I was looking at simplifying some list comprehensions yesterday and
noticed that using sets + removing unnecessary sorted() calls in
GLModuleTable reduces the time of ./import-tests/test-all.sh from 4.8
seconds to 4.5 seconds consistently. A truly life changing amount of
time.
You can probably notice this by looking in
GLModuleTable.transitive_closure and
GLModuleTable.transitive_closure_separately. Most of the time we are
checking if a module is in a list, O(N). It makes more sense to use a
set, O(1).
The only issue with that is it becomes annoying to deal with the dummy
module. Is there a reason why that one doesn't get sorted?
Collin
- gnulib-tool.py: Fix 'consider-using-with' pylint warnings., Collin Funk, 2024/04/05
- gnulib-tool.py: Use 'Any' instead of type unions in GLConfig., Collin Funk, 2024/04/05
- Re: gnulib-tool.py: Fix 'consider-using-with' pylint warnings., Bruno Haible, 2024/04/05
- Re: gnulib-tool.py: Fix 'consider-using-with' pylint warnings.,
Collin Funk <=
- Re: gnulib-tool.py: lists vs. sets, Bruno Haible, 2024/04/06
- Re: gnulib-tool.py: lists vs. sets, Collin Funk, 2024/04/06
- Re: gnulib-tool.py: lists vs. sets, Bruno Haible, 2024/04/07
- Re: gnulib-tool.py: lists vs. sets, Collin Funk, 2024/04/07
- Re: Python list micro-benchmarks, Bruno Haible, 2024/04/07
- Re: Python list micro-benchmarks, Collin Funk, 2024/04/07
- Re: Python list micro-benchmarks, Paul Eggert, 2024/04/07
- Re: Python list micro-benchmarks, Collin Funk, 2024/04/07
- Re: Python list micro-benchmarks, Bruno Haible, 2024/04/08
- Re: Python list micro-benchmarks, Collin Funk, 2024/04/08