This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Performance questions


Performance questions

Postby Malmer » May 27, 2002 @ 2:49am

Guess I'm to lazy to conduct as series of tests myself so I just ask here ;)

1) Does namespacing impact anything on performance. Like doing MyNS::Function1(i).

2) Say I have a class with some structs in it. Does this take any performance hit: oImage.oPos.x = 1. How much performance gain do I get if I create a pointer to oImage.oPos and then use that for my x and y values (or in other cases more subvalues depending on which struct). I hope it doesn't have to query the stack for each dot (.) I have...

3) Which is the fastest? Doing a switch statement or doing "else if":s? Guess switch is the fastest...

Thanks!
All your base are belong to us
User avatar
Malmer
pm Member
 
Posts: 768
Joined: Apr 26, 2001 @ 5:15pm
Location: Sweden


Postby refractor » May 27, 2002 @ 9:51am

A lot of it will be compiler specific.

However, my guesses would be:

1) No idea - I'd /presume/ no performance hit 'cos it's more a compiler directive than actual code.

2) In theory, creating a pointer to the structure only performs one dereference to the object, and will then use offsets to address the individual items.

The other way, you *might* be unlucky and have the compiler dereference the object twice... but any decent compiler should keep the dereferenced pointer cached for next use.

... it really does depend on the compiler. If you want to compile that bit of code as ARM and post it here, I/somebody can tell you which it's doing.

(Go to project ->C/C++->Category tab->Listing files-> Assembly with source code).. then look through the assembler files and chop and post the function.

3) We've been through this one before, IIRC. A switch will essentially compile to a large set of elseif statements. The best gain is to *order* the ifs/switches in the most frequent first.

If you've got quite a lot of items to check, use a switch - it's cleaner to read.

Cheers,

Refractor
User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby Malmer » May 27, 2002 @ 12:28pm

User avatar
Malmer
pm Member
 
Posts: 768
Joined: Apr 26, 2001 @ 5:15pm
Location: Sweden


Postby Phantom » May 27, 2002 @ 1:43pm

Give me some good data and
I will give you the world
User avatar
Phantom
pm Insider
 
Posts: 913
Joined: Feb 21, 2001 @ 8:14am
Location: Houten, Netherlands


Postby Dan East » May 27, 2002 @ 2:48pm

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby refractor » May 27, 2002 @ 4:51pm

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby BurningSheep » May 27, 2002 @ 4:58pm

Do you want custom Snails levels? Click
User avatar
BurningSheep
pm Insider
 
Posts: 1226
Joined: Apr 12, 2002 @ 11:49pm
Location: The Netherlands


Postby refractor » May 28, 2002 @ 10:46am

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby BurningSheep » May 28, 2002 @ 1:31pm

Do you want custom Snails levels? Click
User avatar
BurningSheep
pm Insider
 
Posts: 1226
Joined: Apr 12, 2002 @ 11:49pm
Location: The Netherlands


Postby Orpe » May 29, 2002 @ 4:02pm

User avatar
Orpe
pm Member
 
Posts: 78
Joined: Sep 16, 2001 @ 6:51pm
Location: Stockholm, Sweden


Postby Jadam » May 29, 2002 @ 7:21pm

User avatar
Jadam
I'm a STAR!
 
Posts: 3245
Joined: Apr 9, 2002 @ 7:24pm
Location: Stony Brook, NY


Postby refractor » May 29, 2002 @ 9:04pm

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby Jadam » May 29, 2002 @ 9:13pm

yeah, thats what i mean, order it from ARM... refractor, how fast is it? is the compiled code better than eVC++ or couldnt get your PocketPC to work with it??

Would ARM offer support if you purchased the full $4000 version?? And no, i didnt mean Warezed version. That way, you wouldnt really get any support anyways, and some new software is becoming really hard to warez, such as the $5000 software that uses USB Keychains for the Serial Number, the only one i know of is Discreet Combustion for Mac OS X
User avatar
Jadam
I'm a STAR!
 
Posts: 3245
Joined: Apr 9, 2002 @ 7:24pm
Location: Stony Brook, NY


Postby Malmer » May 30, 2002 @ 2:02am

All your base are belong to us
User avatar
Malmer
pm Member
 
Posts: 768
Joined: Apr 26, 2001 @ 5:15pm
Location: Sweden


Postby refractor » May 30, 2002 @ 9:10am

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Next

Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron