Re: doubling the number of tests, but not taking twice as long

2018-07-18 Thread Larry Martell
On Wed, Jul 18, 2018 at 7:59 PM, MRAB wrote: > On 2018-07-18 22:40, Larry Martell wrote: >> >> On Tue, Jul 17, 2018 at 11:43 AM, Neil Cerutti wrote: >>> >>> On 2018-07-16, Larry Martell wrote: I had some code that did this: meas_regex = '_M\d+_' meas_re = re.compile(meas

Re: doubling the number of tests, but not taking twice as long

2018-07-18 Thread MRAB
On 2018-07-18 22:40, Larry Martell wrote: On Tue, Jul 17, 2018 at 11:43 AM, Neil Cerutti wrote: On 2018-07-16, Larry Martell wrote: I had some code that did this: meas_regex = '_M\d+_' meas_re = re.compile(meas_regex) if meas_re.search(filename): stuff1() else: stuff2() I then had

Re: doubling the number of tests, but not taking twice as long

2018-07-18 Thread Cameron Simpson
On 18Jul2018 17:40, Larry Martell wrote: On Tue, Jul 17, 2018 at 11:43 AM, Neil Cerutti wrote: On 2018-07-16, Larry Martell wrote: I had some code that did this: meas_regex = '_M\d+_' meas_re = re.compile(meas_regex) if meas_re.search(filename): stuff1() else: stuff2() I then had

Re: doubling the number of tests, but not taking twice as long

2018-07-18 Thread Larry Martell
On Tue, Jul 17, 2018 at 11:43 AM, Neil Cerutti wrote: > On 2018-07-16, Larry Martell wrote: >> I had some code that did this: >> >> meas_regex = '_M\d+_' >> meas_re = re.compile(meas_regex) >> >> if meas_re.search(filename): >> stuff1() >> else: >> stuff2() >> >> I then had to change it t

Re: doubling the number of tests, but not taking twice as long

2018-07-17 Thread Neil Cerutti
On 2018-07-16, Larry Martell wrote: > I had some code that did this: > > meas_regex = '_M\d+_' > meas_re = re.compile(meas_regex) > > if meas_re.search(filename): > stuff1() > else: > stuff2() > > I then had to change it to this: > > if meas_re.search(filename): > if 'MeasDisplay' in f

Re: doubling the number of tests, but not taking twice as long

2018-07-17 Thread Peter Otten
Larry Martell wrote: > I had some code that did this: > > meas_regex = '_M\d+_' > meas_re = re.compile(meas_regex) > > if meas_re.search(filename): > stuff1() > else: > stuff2() > > I then had to change it to this: > > if meas_re.search(filename): > if 'MeasDisplay' in filename: >

Re: doubling the number of tests, but not taking twice as long

2018-07-16 Thread Larry Martell
On Mon, Jul 16, 2018 at 6:01 PM, Gilmeh Serda wrote: > On Mon, 16 Jul 2018 14:17:57 -0400, Larry Martell wrote: > >> This code needs to process many tens of 1000's of files, and it runs >> often, so it needs to run very fast. Needless to say, my change has made >> it take 2x as long. Can anyone se

Re: doubling the number of tests, but not taking twice as long

2018-07-16 Thread Stephan Houben
Op 2018-07-16, Larry Martell schreef : > I had some code that did this: > > meas_regex = '_M\d+_' > meas_re = re.compile(meas_regex) > > if meas_re.search(filename): > stuff1() > else: > stuff2() > > I then had to change it to this: > > if meas_re.search(filename): > if 'MeasDisplay' in

doubling the number of tests, but not taking twice as long

2018-07-16 Thread Larry Martell
I had some code that did this: meas_regex = '_M\d+_' meas_re = re.compile(meas_regex) if meas_re.search(filename): stuff1() else: stuff2() I then had to change it to this: if meas_re.search(filename): if 'MeasDisplay' in filename: stuff1a() else: stuff1() else: