i feel for() is more human readable. opinions? im posting this because i see a lot of people using memcpy() which in my personal experience has been a little slower.
you are using a for loop to patch bytes? 0_o
Originally Posted by AcidBone
i feel for() is more human readable. opinions? im posting this because i see a lot of people using memcpy() which in my personal experience has been a little slower.
What are you talking about? for() is a for loop, while memcpy(), is a function that copies bytes to a certain location in memory.
Posts 1–15 of 19 · Page 1 of 2
Post a Reply
Tags for this Thread
None
Originally Posted by AcidBone
i feel for() is more human readable. opinions? im posting this because i see a lot of people using memcpy() which in my personal experience has been a little slower.
they have completely different functions and uses...
For loop != memcpy...
for statement != memcpy bro
Originally Posted by AcidBone
i feel for() is more human readable. opinions? im posting this because i see a lot of people using memcpy() which in my personal experience has been a little slower.
Haha. You really don't know shit about C++, do you?
eh, kinda. i mean more along the lines of dropping fps. ive got a shit ton of redundant for()s, but ive always read that memcpy() is a slow function. just wondering if i should try to reduce my fors or if my lag is coming from memcpy.
memcpy is not a slow function. Only If called multiple times non-stop,.
Originally Posted by AcidBone
eh, kinda. i mean more along the lines of dropping fps. ive got a shit ton of redundant for()s, but ive always read that memcpy() is a slow function. just wondering if i should try to reduce my fors or if my lag is coming from memcpy.
yeah, it's totally slow because it takes a few microseconds to execute ..
Originally Posted by freedompeace
yeah, it's totally slow because it takes a few microseconds to execute ..
have it on a non delayed infinite loop. you will def. notice it.
You best bet is to look up on msdn exactly where the function derives from, for example it could be part of user32 module which calls another module ect.. ect.. just like when you use WriteProcessMemory is alot slower because of this reason...
Originally Posted by AcidBone
have it on a non delayed infinite loop. you will def. notice it.
infinite loop? since when does that represent a real-life application of that |:
the speed would also be the same... right? Well basically my game uses memcpy about 5 times every frame to copy 5(1280*1024*4) = 26 214 400 bit array (of different renders via. IPC) while still maintaining godd FPS. And IPC is dreadfully slow.
Originally Posted by AcidBone
have it on a non delayed infinite loop. you will def. notice it.
memcpy is (at least with Visual Studio) an optimized assembly function. Hand written assembly will nearly always be faster than C++, unless the assembly coder has no idea what he is doing. I believe memcpy copies in DWORD chunks also, which would make it much faster than a for loop.