Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 06:42

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Cost of accessing a casted variable vs. assigning the casted variable? (C#)

Discussion on Cost of accessing a casted variable vs. assigning the casted variable? (C#) within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
Lateralus's Avatar
 
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 920
Cost of accessing a casted variable vs. assigning the casted variable? (C#)

I know that in unmanaged C++, casting is at compile-time, so it's better to avoid the assignment and simply access it for all instances. However, in C#, I have no idea since I'm pretty new to it.
Lateralus is offline  
Old 01/05/2011, 10:36   #2
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
I know this is offtopic, but you need a link back on your site in signature, else is not allowed.
Syst3m_W1z4rd is offline  
Old 01/05/2011, 10:39   #3
 
Lateralus's Avatar
 
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 920
Quote:
Originally Posted by Syst3m_W1z4rd View Post
I know this is offtopic, but you need a link back on your site in signature, else is not allowed.
I have a linkback, it's under advertising affliates. Unless I should state the location in my signature as well?

Any idea on the topic?
Lateralus is offline  
Old 01/05/2011, 13:45   #4
 
Nullable's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 390
Received Thanks: 321
Assigning the casted variable would be better; because each cast to that variable would add another "castclass" instruction per cast.
Nullable is offline  
Thanks
2 Users
Old 01/05/2011, 13:50   #5
 
Lateralus's Avatar
 
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 920
Quote:
Originally Posted by Nullable View Post
Assigning the casted variable would be better; because each cast to that variable would add another "castclass" instruction per cast.
Ah, I see. Thank you.
Lateralus is offline  
Old 01/05/2011, 16:05   #6
 
elite*gold: 20
Join Date: Aug 2007
Posts: 1,749
Received Thanks: 2,199
Quote:
Originally Posted by Nullable View Post
Assigning the casted variable would be better; because each cast to that variable would add another "castclass" instruction per cast.
That said, casting objects/variables shouldn't really be THAT intense/time consuming for most CPUs, and the performance loss is measured in perhaps a few nanoseconds. I'd worry about a lot of other things before worrying about object casting performance.
IAmHawtness is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Variable ?!
11/27/2010 - AutoIt - 14 Replies
Huhu E*PvP :) Ich habe mal wieder eine frage :D.. mir wurde ja schon öfters gesacht das ich meinen source "Besser gestalten soll". Also dachte ich mir mhm ok..! und ich wollte wissen wie ..am also ..og >_<
Überprüfen ob Variable Eine Variable ist
10/16/2010 - AutoIt - 26 Replies
Hey leute ich wollte fragen ob/wie man überprüfen kann ob eine Variable eine Variable ist z.b. so $k = 1 $i = $k if $i = VARIABLE Then msgbox(0,'$i ist eine variable!!','') endif PS:Wp releast man nochma TuT (z.b. für metin2??)
Error Variable used .....
05/26/2010 - AutoIt - 3 Replies
Hi, #include <NomadMemory.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 625, 445, 193, 125)
Variable und down/up befehl
09/23/2009 - AutoIt - 0 Replies
Hallo! Also ich habe folgendes Problem: Ich will meine variable ($taste1) und den "{down}" tastendruck ausführen aber wie krieg ich das hin also möchte das die variable taste1 runtergedrückt wird bis ich sie wieder mit "{up}" loslasse. Allerdings weis ich es bei up auch nicht Mein script sieht bisher so aus Send($taste1 "{down}") Thx schonmal in vorraus:confused::( ok habs jetzt nach langer zeit =) ich hab es einfach über eine if schleife gemacht Ok Funktioniert doch net hat keiner...
How do I add a variable
08/21/2009 - CO2 Private Server - 4 Replies
Couldn't find a guide when I searched. I want to make a variable so it will check how many times the player has already used unknown man. I know how to use the variable, but just don't know how to make it. Oh yea this is LOTF



All times are GMT +1. The time now is 06:42.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.