Re: to be effcient or not to be efficient

"Toby Hudon" <[email protected]>
Newsgroups gmane.comp.multimedia.media-api
Message-ID <[email protected]>
----- Original Message -----
From: Steve Lhomme <[email protected]>
Date: Wed, 07 Jan 2004 19:58:09 +0100
To: "The attempt to create a new,  open standard codec API" <[email protected]>
Subject: Re: [Media-api] to be effcient or not to be efficient

> Tuukka Toivonen wrote:
> 
> > On Wed, 7 Jan 2004, Tuukka Toivonen wrote:
> > 
> > 
> >>Actually I'm surprised if an optimizing C compiler can't do it
> > 
> > 
> > Just checked: gcc-2.95.4 can do it automatically, without even any
> > optimization. So use large switch...case without fear, C compiler can
> > optimize it into a single table lookup and a jump.
> 
> Good. That's also what I thought. I don't think a switch/case has much 
> CPU hit. Unless you have a good way to reduce the (growing) number of 
> possible messages.
> 

I think the switch is going to be an insignificant hit compared to the processing done in other areas. If people are really that concerned, are we going to see functions inlined into the switch cases instead of being called from there? Is a function call THAT expensive with pass by reference parameters? This is like saying functions are too expensive so let's just put 30,000 lines in main().
-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.