特别关注: 性能问题

FengYuanMSFT 2006-01-09 04:25:15
Performance:

1) Algorithm
2) Data structure
3) Memory allocation (global variable, constant, stack, heap, virtual memory)
4) Binary size
5) C++ (template, STL, exception handling)
..

欢迎讨论
...全文
249 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
DrSmart 2006-01-10
  • 打赏
  • 举报
回复
晕死,啊啊出书
皮皮鲁 2006-01-10
  • 打赏
  • 举报
回复
刚才都没有注意
原来老大发的贴
FengYuanMSFT (袁峰 www.fengyuan.com)

今天在google的一个讨论组看到有人提起了你的那本书了。
http://groups.google.com/group/microsoft.public.win32.programmer.kernel/browse_thread/thread/3d8db27932c26aa2/13734d109b56e770#13734d109b56e770


Jonathan Wilson
Jan 9, 9:03 pm show options
> Please see the book
> 'Windows Graphics Programming Win32 GDI and DirectDraw®' by Feng Yuan.


That book discusses some good stuff about the internals of the graphics
subsystem (including gdi32.dll and the gdi side of win32k.sys) but not
about the windowing subsystem (which is, for the most part, in user32.dll
and the user side of win32k.sys) which is what the OP asked about.
As far as I know, there is really no public information on the windowing
subsystem of windows. The closest thing that exists would be the windows
source code which some people have legitimate access to and others have
illegal copies of or the source code to something like ReactOS (although
the internals of the windowing subsystem in ReactOS probobly dont match the
internals of the windowing subsystem in any version of windows)
ddddh 2006-01-10
  • 打赏
  • 举报
回复
一点点体会。

关于c++的容器(list/set/map,以块状分配内存的vector除外),分两种情况来看,一种是类型很小,另外一种是类型很大。

类型很小的时候,比如说int类型,我试过map<int,int>,它会为每个节点分配24个字节,而vc自带stl实现的allocator只是转发到operator new上,对于这么小的分配需求,默认的allocator就不一定合适了,时间空间效率都不会太好。我在vs2oo3 toolkit上测试复制一个大小为2000的map<int,int>,然后再插入2000个,时间大约是70毫秒(debug版,release版块的多)。所以这时候一个特殊的小对象分配器非常必要。据说sgi stl的默认allocator不是简单的转发到new,而是从池里面分配的,那么情况应该会好很多。我觉得vc stl的默认allocator也应该具有池分配的功能,否则对小对象的分配很不友好。

当类型很大的时候,因为stl容器是值语义,那么如果容器容纳了很多的对象,对象的拷贝构造函数*可能*会引起较大的开销。


一点浅见,欢迎探讨:)
vc_gis 2006-01-10
  • 打赏
  • 举报
回复
路过,学习...
ahzhuo 2006-01-10
  • 打赏
  • 举报
回复
一个字:牛X!
vcmute 2006-01-09
  • 打赏
  • 举报
回复
6)instructions set,MMX/SSE Intrinsics
7)physical page,cache miss
8)PCI/MEM/DMA Data Transform
9)Multi-Thread vs Process
etc.
pomelowu 2006-01-09
  • 打赏
  • 举报
回复
回复人: oyljerry(【勇敢的心】→ ㊣My Ticket√㊣) ( ) 信誉:130 2006-01-09 17:07:00 得分: 0


估计老大想出书了~


老大想再出一本……
DrSmart 2006-01-09
  • 打赏
  • 举报
回复
用asm吧,快但是算法描述几乎为0,呵呵c就行了,搞acm的都喜欢boost库,准stl嘛,但是很人性化
wshcdr 2006-01-09
  • 打赏
  • 举报
回复
1) Algorithm
2) Data structure
3) Memory allocation (global variable, constant, stack, heap, virtual memory)
4) Binary size
5) C++ (template, STL, exception handling)

....

不同的语言对于性能的表现的影响是显而易见的,C++当然不如C快,如果采用了相同的语言,相同的平台,那么算法和数据结构的确定,是影响性能的最关键因素,如果,5,1,2都确定的话,才轮到讨论内存的分配,对于第四点...静听他人高见了
菜牛 2006-01-09
  • 打赏
  • 举报
回复
分数竟然这么少?
菜牛 2006-01-09
  • 打赏
  • 举报
回复
这、这、这,什么意思?
老夏Max 2006-01-09
  • 打赏
  • 举报
回复
这个论题适当可以针对一个应用或者平台考虑。不同的应用考虑的偏重点也是不同的。Performance这个东西也是很广义的概念。
老夏Max 2006-01-09
  • 打赏
  • 举报
回复
紧紧是讨乱这些对Performance的影响???
oyljerry 2006-01-09
  • 打赏
  • 举报
回复
估计老大想出书了~
billy145533 2006-01-09
  • 打赏
  • 举报
回复
楼主的意思不是让大家出书
应该是谈谈自己编程设计时,如何考虑和应用以上几点
说说自己的经验吧
ahzhuo 2006-01-09
  • 打赏
  • 举报
回复
这些内容都已经够出本书了,呵呵
HelloIvan2005 2006-01-09
  • 打赏
  • 举报
回复
太大台广泛了
pomelowu 2006-01-09
  • 打赏
  • 举报
回复
这个题目好大~

16,551

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧