Funny Comic

Discussion about everything. New games, 3d math, development tips...
Post Reply
Ein
Posts: 33
Joined: Thu Feb 12, 2009 11:39 pm
Location: UK - Matrix
Contact:

Funny Comic

Post by Ein »

You've probaly seenthis but I thought it was funny ^_^

Image

from Clicky. I've been wondering is there any speed difference from useing switch and an if statment?

Thanks,
Pete
Ein knowledge seeker
loki1985
Posts: 214
Joined: Thu Mar 31, 2005 2:36 pm

Post by loki1985 »

AFAIK most modern optimizing compilers decide on their own whether to translate switch statements to JNE/JE lists (assembler style of if()) or to use offset tables instead.

so it should make no difference.
aanderse
Posts: 155
Joined: Sun Aug 10, 2008 2:02 pm
Location: Canada

Post by aanderse »

This http://developer.amd.com/documentation/ ... 04126.aspx article offers some advice on switch vs. if statements.
See #6.
Pyritie
Posts: 120
Joined: Fri Jan 16, 2009 12:59 pm
Contact:

Post by Pyritie »

bleh, xkcd.

MS Paint Adventures is better :3
Hive Workshop | deviantART

I've moved to Ogre.
Post Reply