• Advertisement
Sign in to follow this  

WARNING: memcpy() is slow, or at least it seems that way.

This topic is 4899 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
You can use asm to code a 32 or 64 bit copy fumction that copys more than one byte at a time, if you need extra speed. What are you copying?

Share this post


Link to post
Share on other sites
Quote:
Original post by Shard
You can use asm to code a 32 or 64 bit copy fumction that copys more than one byte at a time, if you need extra speed. What are you copying?


Most modern memcpy implementations will do that too, though it never hurts to check - if that's really your bottleneck.

Share this post


Link to post
Share on other sites
1000 times per frame seems a little excessive IMHO. It may be worth examining how you're storing your data and attempting to precache it in a buffer before the level loads. I'd say that one call to memcpy on a large buffer would be better than many calls on smaller buffers. Plus look into 32/64bit asm versions as the other have said.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement