Re: [Pyunit-interest] comments on PyUnit
Brought to you by:
purcell
From: Steve P. <ste...@ya...> - 2001-04-23 15:32:59
|
Chuck Esterbrook wrote: > At 04:37 PM 4/23/2001 +0200, Steve Purcell wrote: > >If the interpreter needs to be told what optimisations to make by the > >user, there is something wrong, and opportunities are then rife for code to > >appear that *requires* certain optimisations. Next, there'd have to be > >pragmas, right? > > I disagree. What kind of code are you writing that *requires* an > optimization? Presumably an optimization is a change in code generation > that results in exactly the same program semantics with (hopefully) faster > execution. That was my point. I don't think code should ever be tied to interpreter optimisations. If user-controllable optimisations were added to the interpreter, people would enter the mindset of "module x requires optimisations y,z", and then next they would automatically but illogically scream for the kind of pragmas that proved useless in Perl: use less memory; Yeuch. > Basically, if Python continues to couple -O with "disable assert", then I > will never be able to use -O even in production, because the performance > gain of removing assert is practically nothing and the value of catching > errors early is substantial. > > If currently -O doesn't provide much performance gain, then I guess it's > not a big deal. But if a future version does, then I will want to use it > while keeping my asserts. Hence my suggestion that -O be used *only* to remove asserts. Then you and I would not use '-O' ever, and the interpreter would deal with optimisations in a manner transparent to our code. -Steve -- Steve Purcell, Pythangelist Get testing at http://pyunit.sourceforge.net/ Any opinions expressed herein are my own and not necessarily those of Yahoo |