从Microsoft STL切换到STLport [英] Switch from Microsofts STL to STLport

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

问题描述

我在Windows下的性能关键C ++代码中使用了相当多的STL。一个可能的便宜的方式来获得一些额外的性能将是改变到一个更快的STL库。

I'm using quite much STL in performance critical C++ code under windows. One possible "cheap" way to get some extra performance would be to change to a faster STL library.

根据 post STLport更快,使用更少的内存,但它是几岁。

According to this post STLport is faster and uses less memory, however it's a few years old.

最近有没有人进行过此次更改,您的结果是什么?

Has anyone made this change recently and what were your results?

推荐答案

我没有比较STLPort和MSCVC的性能,但是如果有一个 差异。 (当然,在发布模式 - 调试版本可能会有很大的不同。)不幸的是,你提供的链接,以及任何其他比较我看到,太细的细节是有用的。

I haven't compared the performance of STLPort to MSCVC but I'd be surprised if there were a significant difference. (In release mode of course - debug builds are likely to be quite different.) Unfortunately the link you provided - and any other comparison I've seen - is too light on details to be useful.

在考虑更改标准库提供程序之前,我建议您大量配置您的代码以确定瓶颈在哪里。这是标准的建议;在尝试任何性能改进之前总是配置文件!

Before even considering changing standard library providers I recommend you heavily profile your code to determine where the bottlenecks are. This is standard advice; always profile before attempting any performance improvements!

即使分析确实在标准库容器或算法中显示性能问题,我建议您先分析使用它们。算法改进和适当的容器选择,特别是考虑大O成本,更可能更有可能带来更大的性能回报。

Even if profiling does reveal performance issues in standard library containers or algorithms I'd suggest you first analyse how you're using them. Algorithmic improvements and appropriate container selection, especially considering Big-O costs, are far more likely to bring greater returns in performance.

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

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