Jump to content
  • Advertisement
Sign in to follow this  
quaker

STL Saves or Enslaves?

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

How wise is using STL containers (lists) in a fast-paced game instead of creating the sturctures form scratch? Hurts efficiency? More overhead which is noticeable to the player? Or slight drop in frame per second counter like q couple of frames? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Depends on what you're doing. An STL list is a linked list and shares the same basic performance properties.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Lets put it this way: You're probably not gonna be able to write a faster doubly linked list yourself ;)

Share this post


Link to post
Share on other sites
I'd say that STL will give better performance than pretty much any home-brewn container, if used correctly. I highly recommend STL.

Share this post


Link to post
Share on other sites
Quote:
Original post by Mushu
I'd say that STL will give better performance than pretty much any home-brewn container, if used correctly. I highly recommend STL.


Ditto. And even if your linked list is somehow faster, it's not going to be more robust or cleaner than the STL implementation, which has been banged on for years by people much smarter than yourself. [grin]

Share this post


Link to post
Share on other sites
And since some ppl here offend my intellignece "smarter than yourself," and "You're probably not gonna be able to write a faster..."

I say yup I can write much much faster close to the speed of photons and much faster and efficient doubly linked list with random access facility and sorting capabilities and memory management to beat up the hell out of the CPU and guess what, it runs on GPU using a shader language. Just kidding!

Anyway thanks for ur replies, I will go with STL.

Share this post


Link to post
Share on other sites
If there's one STL container you CAN beat though, it would be the set, but only by caching or preallocating nodes for a binary search tree which I believe most implementations of set use.

Share this post


Link to post
Share on other sites
Quote:
Original post by quaker
And since some ppl here offend my intellignece "smarter than yourself," and "You're probably not gonna be able to write a faster..."


They're much smarter than the rest of us too. Some of the people working on the STL are the same people working on the C++ language itself -- people way smarter than you, or I, or probably anyone on this site are working on this stuff every day and making it more robust and solid.

Regardless of their intelligence, spending weeks re-writing most of the STL is just stupid. That time could be better spent writing game code, and I'm pretty sure you must have bigger performance sinks in there than the STL.

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!