View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-18-2012 , 17:03   Re: Get CommunityID (SteamID64) String
Reply With Quote #20

Quote:
Originally Posted by 11530 View Post
Zephyrus, your version looks pretty slow to me. Unless you think integer addition is slower than using temp strings, multiple formats, StringToInts, ReplaceStrings, and needless if-statements - not to mention the fact your code won't detect other non-normal SteamIDs. Most of your code really isn't needed (and about 50% longer) - you should think twice before saying those functions are way better than basic addition/subtraction. Please think again before posting code which is very similar to a post someone made a year ago too.

Just to confirm your code however, I've ran a quick profile on it, running each function 100,000 times. Twice.

Your code - Avg. Time: 0.081687 then 0.094406 (0.0880465 total avg.)
My code - Avg. Time: 0.072591 then 0.067664 (0.0701275 total avg.)

Profilers are never complete proof, but at least it stops you, Zephyrus, from using awkward phrases like "this is way better".
To be honest, Zephyrus's version could probably be optimized by replacing the Formats with strcats and IntToStrings as appropriate, but I'm too lazy to see if it actually makes a difference.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 12-18-2012 at 17:04.
Powerlord is offline