How Much speed the usage of Bitwise operations bring ?

Started by
24 comments, last by Washu 19 years, 6 months ago
well do your best...
You can't insist what you want because you are from gamedev...
you change it and i take another account and write a story to my
signature...
In my country,we chose to solve controversys with kindly behaviours.Not with insistence.
Your behaviour was more crap than my signature.Do your best ok??
you are stuff.You are king.you can change the world comeee onnnn....:))
Essegin Ziki:) bunu bu sitede imza hesabına yazsam kimse anlamaz!!!:)
Advertisement
General advise: Nano-optimisation is evil. Unless you need the extra bit of performance (e.g. because you are targeting embedded hardware) you shouldn't care.

As for point c) - profile first. casting a COLORREF to a struct may be sufficient and more readable.
struct ArgbColor {   unsigned Blue  : 8;   unsigned Green : 8;   unsigned Red   : 8;   unsigned Alpha : 8;};COLORREF c1;ArgbColor &c2 = reinterpret_cast<ArgbColor>(c1);c2.Red = 128;

Quote:Original post by tonymontana
well do your best...
You can't insist what you want because you are from gamedev...
you change it and i take another account and write a story to my
signature...
In my country,we chose to solve controversys with kindly behaviours.Not with insistence.
Your behaviour was more crap than my signature.Do your best ok??
you are stuff.You are king.you can change the world comeee onnnn....:))


This argument doesn't even sound good when it comes from someone who speaks the language (English in this case) natively.

In case you haven't noticed, this is not a country we are talking about here, it is a message board. You do not necessarily have freedom of speech, and what would normally be social customs are basically elevated to the status of law.
Quote:Original post by tonymontana
Your behaviour was more crap than my signature.Do your best ok??
you are stuff.You are king.you can change the world comeee onnnn....:))


Er. No. Your signature takes up a full page in quite a high resolution. For that, "Change your signature" in nothing more than bold font was pretty kind. There are unwritten rules on the internet (at least those parts where sp34k1n9 1ik3 7h1s is not considered cool) and you violated them. There was a time when people spent some time learning those rules but, alas, nowadays the best you can hope for is they learn them mistake by mistake, hopefully without much of a fuss.
So, stop this mess and pick a proper signature (and stop trying to make an issue out of it. Your supposed right for any signature you like contradicts the right of every serious user for readable threads). Otherwise, just leave and find a board where they like annoying signatures. Good luck with that though.
Sorry, that Anon poster above is me.
tonymontana,

GameDev.net is a privately owned company, in which Dave is the "boss". GameDev has to adhere certain laws in the US to prevent from being fined, and because of that they made rules.

One of these rules(although not forced by law, but by communist GameDev) is that you follow any directions(Or orders) from the administrators and moderators. Not following these rules, might result in being suspended, banned or your entire IP range blackholed.

GameDev isn't a democracy, it's communist. And besides, the overall community hates the kind of behaviour you are displaying in this thread.

Toolmaker

I run at the second highest standard resolution (1280 by 1024, with 1600 by 1200 being the highest standard resolution). Your signature took a page of my screen. Being a shit about it and not just changing your signature when it's that long is immature and stupid. I do hope Dave gets on that bit toggling soon.
Quote:Original post by tonymontana
well do your best...
You can't insist what you want because you are from gamedev...
you change it and i take another account and write a story to my
signature...

Yeah, because GameDev isn't able to block by IP address...
If you create a new account, and its verified that you did it just to sidestep Dave, you're just asking to get your IP range blocked, making it impossible for you to even view the forums.

Quote:Original post by tonymontana
In my country,we chose to solve controversys with kindly behaviours.Not with insistence.
Your behaviour was more crap than my signature.Do your best ok??
you are stuff.You are king.you can change the world comeee onnnn....:))

If you have that attitude in Real Life, you're in for a hard time...

Back to the actual question:
Quote:Original post by tonymontana
a) multiplyin 2 or dividing by 2
b) swipping two variable values without a need of a third one
c) changin some part of a Variable that hold many knowledges
(for ex: taking the RED bytes from a COLORREF)

a) The compiler will do that for you, don't worry about it. All it does is make your code harder to understand.
b) Using the XOR technique is SLOW. Its totally breaks the CPUs pipeline. Don't do it. Just use a tempoary unless you have an exceptionally good reason.
c) Bitwise operators are the only way to do things here.

Generally, don't worry about tiny optimizations like this, profile your code, and see if its a problem. If it is (which 99.99% of the time it won't be) then you an go ahead and try to optimize it.
Quote:Original post by Anonymous Poster
... There are unwritten rules on the internet ...


Well, it seems they have been written some days ago (or was it years ?) : the netiquette guidelines, RFC 1855.

This is still not really on-topic :)

Regarding the question of tonymontana : shift operations are faster than multiply or divide by their equivalent (power of two). But they are also mush less readable than their counterparts. Not to mention that any good compiler will optimize a "* 32" by itself (so their is no point of using a >> N or << N where N is a constant which is known at compile time). My advice: this is at least micro-optimization. It may be useful in a software renderer inner loop. May be. Not sure...

Regards,
First of all it is a debt to thank all of the poster that wrote about actual issue(Bitwise operations).
i think i would just use them when passing arguments to functions
as ShowCreatureImage(ANIM_LOOP|ANIM_CONTINUE ) vb...as dword flags..
And i want to say something to the poster who cared about my signature.Ý changed it (Kýçýnýza kýna yakýn...:)) but i didn't changed by the insistence of you.I have a private message that wass kindly and reasonable.I think you can never get somewhere with that style(in game programming or somewhere else )..what was that
You left all the things on earth and started to attack me..)
Anyway the post about immaturity and stupidity was really a annoying thing.)i am 22 and believe me i am intellegent enough..(chess champion,civil engineer,got degrees on exams...that all requires it.).and comparing to your replys i am more mature .You should admit that to yourself.Ýf i saw a signature that is long (and the owner says he will not post it because he is already aware of it's length)i wouldn't say anything..

ok that is the end of it i didn't blame or attack anyone.And i want to stop it noone will write anything on that post about my signature...if you want post me in private .
Thanks for your reading..(by the time i spend to defend of myself to your unneccessary blames i could learn something new)
Essegin Ziki:) bunu bu sitede imza hesabına yazsam kimse anlamaz!!!:)

This topic is closed to new replies.

Advertisement