Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

rico

Is STL slow for tile/map based games

This topic is 5386 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

if I use STL structures such as list or vectors in tile/map based games, will it have a speed/performance issue?

Share this post


Link to post
Share on other sites
Advertisement
That would probably depend on what you where doing with them and how large you wanted them to be.. but in general NO, if you can write something faster your self then go ahead, but why would you want to do that?

I would say use the STL containers and get the game working... if you find it slow (don''t think you should) then rework the section that is using STL to use your own homebrew.

That way you''ll see results faster and will be able to work out your design.

Please visit Turt99 Productions

Share this post


Link to post
Share on other sites
You shouldn't have any trouble with performance if you decide to use the STL - it was designed with performance as one of the main considerations and, as such, there are various performance guarantees in the spec. If you check http://www.sgi.com/tech/stl/ you can look up the performance guarantees for the various containers. For example, vectors have guaranteed constant time access to random elements, and constant time appending values to the end of a sequence (i.e. Vector:ush_back()).

Generally, if you find that you can do something faster yourself than with STL, it's because you're not using the STL properly. Of course, there'll be situations where the STL isn't a perfect fit and some other solution would be more suitable, but those occasions should be fairly rare. (Which is why I said "generally" above.)

[edited by - hinch on September 23, 2003 9:08:01 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!