Re: gnulib-tool.py: lists vs. sets

2024-04-07 Thread Collin Funk
Hi Bruno, On 4/7/24 4:56 AM, Bruno Haible wrote: > In my opinion, both are good ways to express the same thing. > The second one is more expressive; but we all can store a 3-lines > snippet of code in our short-term memory. Yeah, it isn't bad. Just personal preference I guess. Two more lines for

Re: gnulib-tool.py: lists vs. sets

2024-04-07 Thread Bruno Haible
Hi Collin, > I was trying to cleanup list comprehensions from this: > > file_table = sorted([ file > for file in table1 > if file not in table2 ]) > > to this: > > file_table = sorted(set(table1).difference(table2)) > > because I find

Re: gnulib-tool.py: lists vs. sets

2024-04-06 Thread Collin Funk
Hi Bruno, On 4/6/24 6:41 AM, Bruno Haible wrote: > * gnulib-tool.py is between 2x and 300x faster than gnulib-tool.sh, depending > on the arguments. This means, the goal of speedup has been fully achieved. > The other goals (clear code, maintainability, etc.) are still present. Yes, I meant t

Re: gnulib-tool.py: lists vs. sets

2024-04-06 Thread Bruno Haible
Hi Collin, > 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.