TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Libstdc++ has a "diagnostics" mode that suggests alternate containers

57 点作者 dhruvbird大约 14 年前

2 条评论

asymptotic大约 14 年前
The actual introduction page is far more enlightening:<p><a href="http://gcc.gnu.org/onlinedocs/libstdc++/manual/profile_mode.html#manual.ext.profile_mode.intro" rel="nofollow">http://gcc.gnu.org/onlinedocs/libstdc++/manual/profile_mode....</a><p>The work is published under an application called "Perflint". Here's a link to the PDF for the paper:<p><a href="http://0-portal.acm.org.millennium.lib.cyut.edu.tw/ft_gateway.cfm?id=1545076&#38;type=pdf" rel="nofollow">http://0-portal.acm.org.millennium.lib.cyut.edu.tw/ft_gatewa...</a><p>"Abstract—We present perflint, a new industrial strength open source analysis tool that identifies suboptimal use patterns of the C++ standard library. Simply by recompiling and running on a representative input set, programmers receive context sensitive performance advice on their use of standard library data structures and algorithms. Our solution consists of collecting traces of relevant library operations and state during program execution, and then recognizing patterns for which there is a faster alternative, based on a model made of performance guarantees in the C++ language standard and machine knowledge. perflint has already found hundreds of suboptimal patterns in a set of large C++ benchmarks. In one case, following the advice and changing one line of code resulted in 17% program run time reduction."
tom_b大约 14 年前
I think it would be fun to think of this in a more high-level language where data structures could be autonomously tuned by a VM or interpreter.<p>That way, you could start out with lists when prototyping and building up your app, but under the covers, at runtime, your underlying data structure could swap into something else that optimized your usage pattern. I also think that although this idea sounds fun, that it is premature optimization of the worst kind.<p>I do think that the idea of Perflint, where you do a little profiling up front as the dev, is much better than trying to use some embedded heuristics. Probably just realizing that its worth doing a little "real world data size" testing makes something Perflint valuable.
评论 #2477312 未加载
评论 #2477070 未加载