更新时间:2023-11-10 15:45:46
分析器无法在这里为您提供帮助.两者都不会估计数据结构的大小.
A profiler will not help you here. Neither will estimating the size of data structures.
探查器可以肯定地告诉您代码在哪里花费了最多的CPU时间,但不会告诉您是否缺少性能目标-例如,您的用户对应用程序在任何给定系统上的性能感到满意还是不满意.
A profiler can certainly tell you where your code is spending the most CPU time, but it will not tell you if you are missing performance targets - e.g. if your users will be happy, or unhappy with the performance of your application on any given system.
仅计算数据结构的大小,并且一次只能分配多少个结构,根本就无法使您准确地了解一段时间内的内存使用情况.原因是内存使用量由许多其他因素决定,包括应用程序执行多少I/O,应用程序使用什么OS服务以及最重要的是应用程序使用内存的时间性质.
Simply computing the size of data structures, and how many may be allocated at any one time will not at all give you an accurate picture of memory usage over time. The reason is that memory usage is determined by many other factors including how much I/O your application does, what OS services your application uses, and most importantly the temporal nature of how your application uses memory.
了解最低要求的最有效方法是
The most effective way to understand minimum requirements is to
您可以对CPU和其他组件(例如磁盘,网络或GPU)执行相同的操作.
You can do the same with the CPU and other components such as disk, networking or the GPU.
还要注意,这里没有简单的答案-在设定最低要求上做有效的工作是真正的工作.如果您的应用程序对一个或多个平台方面都具有参与性,则尤其如此.
Also note that there is no simple answer here - doing an effective job at setting minimum requirements is real work. This is especially true if your application is participatory sensitive to one platform aspect or another.
还有其他因素-例如,您的应用程序可能在一种配置中运行良好,直到用户打开另一个可能会占用内存或CPU的应用程序.用户很少只打开一个应用程序.
There are other factors as well - for example, your app may run fine in one configuration until the user opens another application that may be memory hungry or a CPU pig. Users rarely only have one application open.
这意味着,除了指定最低要求之外,您还必须在设置用户期望方面做得有效-这说明了您的应用程序何时会运行良好,何时无法运行以及影响性能的因素是什么.
This means that in addition to specifying minimum requirements you must do an effective job in setting user expectations - that is explaining when your application will perform well, and when it won't, and what the factors are that impact performance.
[1]: http://msdn.microsoft.com/en -us/library/ms751538.aspx 强文本