Click here to Skip to main content
15,949,686 members
Home / Discussions / C#
   

C#

 
AnswerRe: Activation Code Pin
Christian Graus24-Feb-09 9:52
protectorChristian Graus24-Feb-09 9:52 
Question[Message Deleted] Pin
ioctl5124-Feb-09 8:08
ioctl5124-Feb-09 8:08 
AnswerRe: What is the standard way to poll a thread for completion? Pin
PIEBALDconsult24-Feb-09 8:41
mvePIEBALDconsult24-Feb-09 8:41 
GeneralRe: What is the standard way to poll a thread for completion? Pin
Pete O'Hanlon24-Feb-09 9:27
mvePete O'Hanlon24-Feb-09 9:27 
GeneralRe: What is the standard way to poll a thread for completion? Pin
PIEBALDconsult24-Feb-09 10:25
mvePIEBALDconsult24-Feb-09 10:25 
QuestionMost efficient switch statement variable to use? Pin
Bruce Coward24-Feb-09 6:34
Bruce Coward24-Feb-09 6:34 
AnswerRe: Most efficient switch statement variable to use? Pin
PIEBALDconsult24-Feb-09 6:49
mvePIEBALDconsult24-Feb-09 6:49 
AnswerRe: Most efficient switch statement variable to use? Pin
Luc Pattyn24-Feb-09 7:17
sitebuilderLuc Pattyn24-Feb-09 7:17 
Hi Bruce,

in general integer operations are fastest for the native word size, meaning 8-bit or 16-bit operations are not faster than 32-bit operations on modern CPUs.

This tells us byte and short mainly exist to support compatibility with existing data structures, files, etc; and of course to economize on memory when using large amounts of them as in arrays.

BTW: This may not be very easy to test, since (1) programming languages use the native size for literal values anyway, and (2) often the compiler will use int operations although byte or short where coded when those ints are equivalent to what you actually coded.

Smile | :)
Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


modified on Sunday, June 12, 2011 8:35 AM

GeneralRe: Most efficient switch statement variable to use? Pin
PIEBALDconsult24-Feb-09 8:43
mvePIEBALDconsult24-Feb-09 8:43 
GeneralRe: Most efficient switch statement variable to use? Pin
DaveyM6924-Feb-09 8:49
professionalDaveyM6924-Feb-09 8:49 
GeneralRe: Most efficient switch statement variable to use? Pin
PIEBALDconsult24-Feb-09 10:40
mvePIEBALDconsult24-Feb-09 10:40 
GeneralRe: Most efficient switch statement variable to use? Pin
harold aptroot24-Feb-09 11:53
harold aptroot24-Feb-09 11:53 
AnswerRe: Most efficient switch statement variable to use? Pin
Luc Pattyn24-Feb-09 14:23
sitebuilderLuc Pattyn24-Feb-09 14:23 
GeneralRe: Most efficient switch statement variable to use? Pin
Deresen24-Feb-09 10:08
Deresen24-Feb-09 10:08 
GeneralRe: Most efficient switch statement variable to use? Pin
harold aptroot24-Feb-09 11:31
harold aptroot24-Feb-09 11:31 
GeneralRe: Most efficient switch statement variable to use? Pin
Deresen24-Feb-09 12:02
Deresen24-Feb-09 12:02 
GeneralRe: Most efficient switch statement variable to use? Pin
harold aptroot24-Feb-09 12:19
harold aptroot24-Feb-09 12:19 
GeneralRe: Most efficient switch statement variable to use? Pin
Deresen24-Feb-09 12:26
Deresen24-Feb-09 12:26 
GeneralRe: Most efficient switch statement variable to use? Pin
harold aptroot24-Feb-09 13:01
harold aptroot24-Feb-09 13:01 
AnswerRe: Most efficient switch statement variable to use? Pin
Ennis Ray Lynch, Jr.24-Feb-09 8:43
Ennis Ray Lynch, Jr.24-Feb-09 8:43 
AnswerRe: Most efficient switch statement variable to use? [modified] Pin
harold aptroot24-Feb-09 11:23
harold aptroot24-Feb-09 11:23 
GeneralRe: Most efficient switch statement variable to use? Pin
harold aptroot25-Feb-09 1:30
harold aptroot25-Feb-09 1:30 
AnswerRe: Most efficient switch statement variable to use? Pin
Mark Churchill24-Feb-09 14:13
Mark Churchill24-Feb-09 14:13 
GeneralRe: Most efficient switch statement variable to use? Pin
PIEBALDconsult24-Feb-09 15:15
mvePIEBALDconsult24-Feb-09 15:15 
GeneralRe: Most efficient switch statement variable to use? Pin
harold aptroot24-Feb-09 15:42
harold aptroot24-Feb-09 15:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.