STL替代 [英] STL Alternative

查看:163
本文介绍了STL替代的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的讨厌使用STL容器,因为他们使我的代码的调试版本运行真的很慢。

I really hate using STL containers because they make the debug version of my code run really slowly. What do other people use instead of STL that has reasonable performance for debug builds?

我是一个游戏程序员,这是许多项目的一个问题, ve工作。在使用STL容器处理所有内容时,很难获得60帧。

I'm a game programmer and this has been a problem on many of the projects I've worked on. It's pretty hard to get 60 fps when you use STL container for everything.

我对大多数工作使用MSVC。

I use MSVC for most of my work.

推荐答案

EASTL是一种可能性,但仍然不完美。电子艺术的Paul Pedriana对游戏应用中的性能进行了各种STL实现的调查,其总结如下:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html

EASTL is a possibility, but still not perfect. Paul Pedriana of Electronic Arts did an investigation of various STL implementations with respect to performance in game applications the summary of which is found here: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html

其中一些调整正在审核中,以便包含在C ++标准中。

Some of these adjustments to are being reviewed for inclusion in the C++ standard.

请注意,即使EASTL不会优化对于非优化情况。我有一个excel文件w /有时间一会儿,但我想我失去了,但访问它是像:

And note, even EASTL doesn't optimize for the non-optimized case. I had an excel file w/ some timing a while back but I think I've lost it, but for access it was something like:

       debug   release
STL      100        10
EASTL     10         3
array[i]   3         1

我最大的成功是滚动我自己的容器。你可以让那些降低到接近array [x]的性能。

The most success I've had was rolling my own containers. You can get those down to near array[x] performance.

这篇关于STL替代的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆