Jump to content
  • Advertisement
Sign in to follow this  
dave

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

This topic is 5117 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!