Mr. Pop don't rule out the notion of using unsafe code in c#. It has purpose's. I do agree with you tho. In c# unless you understand it fully keep away from using unsafe code.
unsafe code it's too messy in c#, and if you are using it because you think you're getting better performance ,in reality, while it might be better, it's not noticeably better, it's a hell of a lot worse to maintain though.
and don't use memcpy on managed memory :P , anyways it's seems OK but try to avoid any unsafe code in you're C# source
Mr. Pop don't rule out the notion of using unsafe code in c#. It has purpose's. I do agree with you tho. In c# unless you understand it fully keep away from using unsafe code.
Agreed
Quote:
Originally Posted by ImmuneOne
You have no idea what you're talking about
i really do! but the question why do you use unsafe while you can use the C# built in functions?
Managed vs Unmanaged in C#... I know these things, but it will give a better idea of the reality and you'll see that the difference is so little that you can use what you want...
Tested on Windows XP x64, for a copy of 50'000'000 elements and tested 1000 times for precision. All values in ms.
Target
Buffer.BlockCopy
Array.Copy
memcpy (void*)
memcpy (IntPtr)
memcpy (void*, fixed byte*)
memcpy (fixed byte*, fixed byte*)
x64
31.547
30.734
30.201
30.922
34.817
29.760
x86
43.606
41.208
37.309
37.626
40.051
37.704
Any
28.422
27.097
25.858
26.542
30.531
26.087
Results:
Allocating managed resources takes more times than unmanaged resources.
Byte[] = new Byte[], Byte* = (Byte*)Marshal.AllocHGlobal()
x64 is fastest than x86 on 64 bits OS.
Any CPU is fastest than x64 on 64 bits OS and probably on 32 bits OS (x86).
Array.Copy is fastest than Buffer.BlockCopy.
There is no difference between void* and IntPtr.
There is no difference between fixed pointer and pointer.
Native function memcpy is fastest than Array.Copy.
I don't see a need to change what anyone is comfortable with because it would be fractions of a nanosecond faster
Hopefully I'm not the only one that sees it that way
I don't see a need to change what anyone is comfortable with because it would be fractions of a nanosecond faster
Hopefully I'm not the only one that sees it that way
Nice release bauss..might save it for later
I changed some few things, if you want to see what, feel free to check out my source ^^
I don't see a need to change what anyone is comfortable with because it would be fractions of a nanosecond faster
Hopefully I'm not the only one that sees it that way
Nice release bauss..might save it for later
Sadly its not fractions of a nanosecond faster, its several milliseconds faster, and when writing a server several milliseconds is a long time.
Tested on Windows XP x64, for a copy of 50'000'000 elements and tested 1000 times for precision. All values in ms.
Correct me if I'm wrong but isn't he saying each function was called 50 million times?
I try to keep things as efficient as possible(I of course don't know as much as a majority of the people reading this)..but I don't see anything I'd design that calls anything hundreds of millions of times
Sockets first to log in after SM 03/14/2007 - Conquer Online 2 - 13 Replies If i was the first to log in after SM will the 1st met be the socket? or is there a certian amount i would have to spam? Thanks :) cheers i have quit this game for a while but I am back now. :P
Sockets in CO? 03/16/2006 - Conquer Online 2 - 14 Replies I was reading through the socket thread on the other forum and such... I know a few people who are 100 pct on making 1 socket and around 90 pct on the 2nd socket... So I am wondering if there is a way to make it happen without a chance of failure? I know that the Conquer Online Beta Client (the old old one) you can make sockets without worry on anything with that client... Does anyone know where to get it or know someone who'd upload it to a server? Or just knows a fool proof way to...
Sockets 03/01/2006 - Conquer Online 2 - 35 Replies Hi there everyone, just like to post what i know about socket making in TC.
I don't post much unless I know what i am talking about. OK I tried pretty much every theory that there is arround about making a socket, I spammed 400 mets, I followed the xx:33 theory for over a month and had no success. But then out of know where I get 2 sockets in one week and another 1 this week by following a simple procedure, ok here it is:
1. Get 20 mets (If 20 mets can't get a socket, I don't think...
HELP WITH SOCKETS! 07/06/2005 - Conquer Online 2 - 6 Replies Hi again, i was thinking about quiting the game but i dicided to try to make sockets in every thing so i sold all my equip(made 60mil) bought low lvl supers/unique/elite and dbs.IM a trojan :D. my boots,necky and attack ring was unique LOW lvl and i gave it all dbs to get super and trojan armor lvl 15 was elite and i made it super and i bought a low lvl super cornet. Today i gave my ring 65 mets and ring reach lvl 80 by doing so no socket :cry: . .any one no the best way i and get sockets.PLZ...