From -7568990711542347594
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,5be30c38f618a07b
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-05-03 10:35:01 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!kibo.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: "Pavel Kuznetsov" <pavel@despammed.com>
Newsgroups: comp.std.c++
Subject: Re: Why switch w/ only integral types?
Date: Fri,  3 May 2002 17:34:09 GMT
Organization: Meridian'93
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <aatv35$dm69h$1@ID-97366.news.dfncis.de>
References: <6ee7d287.0203202005.63e0b7b3@posting.google.com> <qfpm8.12422$cy2.680922353@newssvr21.news.prodigy.com> <3CCE6310.672E55DF@webmaster.com>
X-Trace: mail2news.demon.co.uk 1020447253 mail2news:29164 mail2news mail2news.demon.co.uk
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Orig-NNTP-Posting-Host: 193.227.110.19
Mime-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Orig-X-Trace: fu-berlin.de 1020428199 14358833 193.227.110.19 (16 [97366])
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
FL-Build: Fidolook Express 2001 UIExt. BuildID: 3BC00FAD (7/10/2001 11:17:49).
X-Comment-To: David Schwartz
Lines: 19
Xref: archiver1.google.com comp.std.c++:11012

David Schwartz (davids@webmaster.com) wrote:

DS> and on many platforms is actually slower than 
DS> corresponding if/else code at low levels of optimization.

At least on one platform code generated from switch/case
is a lot faster than that from if/else if. And of course 
speed is not right factor for choosing between if/else 
and case. Readability and ease of maintainance is.

--
Pavel

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



