[MPlayer-dev-eng] -Wall

D Richard Felker III dalias at aerifal.cx
Sat Jun 5 01:52:09 CEST 2004


On Fri, Jun 04, 2004 at 11:46:03PM +0100, J. Grant wrote:
> 
> >NO, ARE YOU FUCKING STUPID?!?! The whole reason the code was written
> >that was is that initializing to zero takes TIME!!!!! MPlayer is not
> >written to be slow crap like other players...
> 
> c'mon, this is basic stuff; you're telling me you really are of the
> opinion that initalising a variable to zero is going to grind mplayer to
> a halt?! If you do, you are severely out of touch with the reality of
> computers since 90's.

No, you're the one who's out of touch. Poking at unnecessary spots in
memory can have all kinds of unpredictable impacts on cache
performance on modern computers. On ancient cisc machines you could
have known for sure that an extra initialization would "only" waste at
most 3 clocks or whatever, but nowadays it's impossible to predict the
impact on all different cpus, and in fact it's stupid to try. If code
isn't needed, DON'T ADD IT. That simple.

> You should keep things in perspective, clean clear code "costs"
> effectively nothing.  You time it and you will not see any difference
> unless you run it at least 1000 times I expect.

Want to count how many times that code runs?? It's a whole damn lot
more than 1000! :)

Still, it might only make 0.05% difference or less, but if you go with
the stupid attitude of not caring, you'll end up with 100 places where
you did similarly bad things, and all the sudden you've lost 5%
performance!

> This is not the 70's,

That's why I don't believe in waste and inefficiency, anywhere.
Whether it's code, power, packaging trash, junk mail, ... People
should become more responsible as time progresses, not less so.

> you don't have to go mad to save an instruction in a compromise of code
> clarification for the compiler.  Remember this is one warning, in
> libavcodec, I bet you did not even read the code before writing your
> bizarre ranting response.

Actually, I _did_ read the code. That's why I know it's
performance-intensive and why I know the variable is not used
uninitialized. You're the one who assumed it was wrong just from the
compiler warning.

Rich




More information about the MPlayer-dev-eng mailing list