C ++ Project to Benchmark A pc [英] C++ Project to Benchmark A pc

查看:58
本文介绍了C ++ Project to Benchmark A pc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是一名12年级学生(印度)。我被要求为我的第12课创建一个c ++项目(总板数的一部分)。所以我想到了许多想法,并希望我的项目成为一个独特而且非常好的项目。



我想到的一个想法是创建一个程序来对PC进行基准测试,所以我开始做一些研究而且我的徒劳无法理解互联网上可用的编码。我不想在互联网上复制粘贴已经可用的编码,但我也不认为我有足够的时间从基础创建一个很棒的产品,所以想到从已经很好的可用产品获得帮助,然后从那些编码开发。



谷歌搜索我偶然发现一个网站,其中包含许多c ++程序,以对PC中的不同组件进行基准测试,该网站是http://www.roylongbottom.org.uk/#anchorStartDoc [ ^ ]。所有这些编码似乎是免费的任何非盈利的目的,所以我认为而不是创建一个程序来自己对PC进行基准测试,我想为什么不把所有这些编码放在一个程序中并使其更容易。我的意思是一个程序,可以帮助用户使用那些已经可用的编码对他们的电脑进我下载了一些并执行了它们。我得到了一些结果,有mflops,no.of int,长计算等等,我可能无法理解。



所以有人可以帮助我理解这些东西是什么意思,它们是如何计算的,或者是否有一些可用的文档。我的项目好吗?



我会将所有这些程序整合到一个程序中。然后要求用户选择要进行基准测试的组件,然后以简化的方式(将数据解释并提供简化的详细信息)提供给新手用户,而高级用户则为整个数据提供一些高级信息。



欢迎任何建议,请帮助我!我不是专家所以请详细说明你的答案。我也不是c ++方面的专家。我为我的第11和第12选择了计算机流,并且在过去的一年里学习了c ++。

Hi guys i'm a class 12 student(India). I was asked to create a c++ project for my 12th class( a part of the total board marks). So i thought of many ideas and wanted my project to be a unique and really good one.

One idea that struck my mind was to create a program to benchmark a pc, so i started doing a bit of research and to my vain just couldn't understand most of the coding available in the internet. I don't want to copy paste already available coding in the internet but i also don't think i would have enough time to create an awesome product from the base so thought of taking help from already good ones available and then developing from those coding.

While googling i stumbled upon a site which contained lots of c++ programs to benchmark defferent components in the pc and that site is http://www.roylongbottom.org.uk/#anchorStartDoc[^]. All those codings seem to be Free for any non-profitable purpose which suits my part so i thought instead of creating a program to benchmark the pc myself i thought why not put all those codings in a single program and make it easier. I mean a program which helps users benchmark their pc with those already available codings. I downloaded a few and executed them. I was given with some results which had mflops, no.of int, long computations etc etc which i could just not understand.

So can someone help me understand what those things mean, how they are computed, or is there some documentation available already on this. Is my project good?

I would put all these programs into one single one. Then ask the user to select which component to benchmark and then give those results in a simplified manner( interpret the data and give simplified details) to novice users and to advanced ones give the entire data with some advanced info.

Any suggestions are welcome please help me! I'm not a expert so be detailed with your answers. I'm also not an expert in c++. I chose computer stream for my 11th and 12th and have been learning c++ for the past year.

推荐答案

好的,mflops的意思是mega(1M)浮点数每秒操作。但它会对你有多大帮助吗?



让我们看看。应用程序(包括基准)从不进行浮点运算。它从其他指令获取浮点数,甚至可能从内存中获取浮点数。内存是虚拟内存,因此可以在磁盘上交换。然后可以从其他CPU指令获取数据,通过总线发送,等等。您的应用程序可能会被其他一些进程抢占。即使只是移动鼠标,也需要一些CPU时间;不,没有进程轮询鼠标设备,但即使处理由鼠标引起的硬件中断也需要在内核环上进行一些CPU工作,然后生成事件并传播到UI ,只是为了显示鼠标指针,忘记处理应用程序级别的鼠标事件。



那么,你实际用某些应用程序测量这样的基准测试工具是什么?以上内容是为了向您展示这个问题并非微不足道。



与所有知识领域一样,您可以选择:您可以创建自己的基准软件和测量原理,包括指标本身,或者你可以从文献中学习这个领域;或者你可以结合两种方法。说到第一种方式,我不会说这是不可能的:您可以根据您对CPU指令集架构,操作以及重要的软件:操作系统和应用程序操作的了解来进行测量。在这里,你的不是C ++专家听起来不太有希望。如果你是这样的专家,到目前为止还不够。学习编程语言。由于多种原因,纯C ++不起作用(前面的段落应该给出理由为什么)。所以,你需要学习另一件事:内联汇编语言(嵌入在C ++中的那个;我不认为绝对需要一个独立的汇编程序)。但即使这样也是不够的:CPU操作本身是一件非常复杂的事情。如果你只是需要做一些计算并得到一些结果,那就容易多了,但是时间需要更多的知识。



但实际上,在所有你要创造,你必须记住:你只能比较苹果与苹果,橘子与橙子。不同的基准测试方法会产生不同的结果。因此,最终,您需要了解其他基准测试应用程序的功能,至少要比较结果并了解差异。坦率地说,这也是其中一个难点。最后,您需要学习基准测试的行业标准,包括但不限于:

http://en.wikipedia.org/wiki/EEMBC [ ^ ],

http://en.wikipedia.org/wiki/SPECint [ ^ ],

http://en.wikipedia.org/wiki/SPECfp [ ^ ],

http://en.wikipedia.org/wiki/Coremark [ ^ ]。



顺便说一句,阅读这些标准组织提供的文档可以快速向您介绍你问的问题



现在,第二种方式怎么样?开始学习有关书签的文献。是否需要了解上述所有内容? 惊喜:是的!



......嗯,也许是次要的细节。否则你不会理解结果意味着什么。我忘了一个方面:你一定会理解数学统计 及其用法,至少是基础知识。为什么。好吧,试着给一些代码计时;如果您不想进行基准测试,只需要进行计时,这很容易。您将观察到的第一件事是结果的巨大的 统计分散。因此,合理地说,您需要收集严格的数据统计数据并测量色散和其他分布时刻,解释这些测量结果。请参阅:

http://en.wikipedia.org/wiki/Statistical_dispersion [< a href =http://en.wikipedia.org/wiki/Statistical_dispersiontarget =_ blanktitle =New Window> ^ ],

http://en.wikipedia.org/wiki/Probability_distribution [ ^ ]。



所以,如果你想在下真的开始了解基准测试(如果你仍然没有太多沮丧:-)),继续学习。也许你可以从这里开始: http://en.wikipedia.org/wiki/Benchmark_%28computing%29 [ ^ ]。



但是,说实话,你还需要从详细学习CPU操作和软件操作开始:操作系统和应用程序。我不敢说,这里连提供链接都不会立即帮助你:你应该自己去挖掘它。



如需额外的鼓励,请阅读一个文章我认为软件工程的每个初学者都应该阅读:

Peter Norvig,十年自学编程

http://norvig.com/21-days.html [ ^ ]。



所以,如果你成功了在你的学习中,你已经有大约10%的进步。 :-)



-SA
Okay, "mflops" means "mega (1M) floating-point operations per second". But will it help you much?

Let's see. The application program (including a benchmark) never does the floating-point operation along. It takes floating-point numbers from other instructions, maybe even from memory. The memory is virtual memory, so it can be swapped on disk. Then data can be taken from other CPU instruction, sent over the bus, and so on. Your application can be preempted by some other process. Even it you simply move your mouse, it takes some CPU time; no, there is no a process polling the mouse device, but even the handling of the hardware interrupts caused by the mouse takes some CPU work at the kernel ring, and then the events are generated and propagated to UI, just to show the mouse pointer, forget about handling application-level mouse events.

So, what are you actually measuring with some application program such a benchmark tool? The above is written to show you that the question is not trivial at all.

As with all fields of knowledge, you have a choice: you can create your own benchmark software and principles of measuring, including the metrics themselves, or you can learn the field from the literature; or you can combine both approaches. Speaking of the first way, I would not say it's impossible: you can do the measurements based on your knowledge of the CPU instruction-set architecture, operation, and, importantly, software: OS and application operation. Here, your "not an expert in C++" doesn't sound very promising. If you were such an expert, it would not be enough, by far. Take the programming language along. By a number of reasons, pure C++ would not work (the previous paragraphs should give the idea why). So, you would need to learn another thing: inline Assembly Language (the one embedded in C++; I don't think a stand-along Assembler would be ever absolutely required). But even this would not be enough: CPU operation itself is a very complex thing. If you just need to do some computing and get some result, it would be much easier, but timing requires a lot more knowledge.

But to be practical, in all you create, you have to remember: you can only compare apples with apples, oranges with oranges. Different ways of benchmarking will give different results. So, ultimately, you would need to get an idea what some other benchmarking application do, at least to compare the results and understand the differences. Frankly, this is one of the hard parts, too. Eventually, you will need to learn industrial standards on benchmarking, including but not limited to :
http://en.wikipedia.org/wiki/EEMBC[^],
http://en.wikipedia.org/wiki/SPECint[^],
http://en.wikipedia.org/wiki/SPECfp[^],
http://en.wikipedia.org/wiki/Coremark[^].

By the way, reading documentation provided by those standard organizations can quickly introduce you to the terminology you were asking about.

Now, how about the second way? Start learning literature on bookmarking. Will it require understanding of all of the mentioned above? Surprise: yes!

…Well, perhaps in lesser detail. Otherwise you would not understand what the results mean. I forgot one more aspect: you will certainly understand mathematical statistics and its use, at least the basics. Why. Well, try to time some code; this is easy if you don't want to make it benchmarking, just do timing. First thing you will observer would be the huge statistical dispersion of the result. So, to time reasonably, you would need to collect serious statistics of your data and measure the dispersion and other moments of distribution, interpret these measurements. Please see:
http://en.wikipedia.org/wiki/Statistical_dispersion[^],
http://en.wikipedia.org/wiki/Probability_distribution[^].

So, if you want to get started under really understand benchmarking (if you are still not too much frustrated :-)), go ahead and start learning. Perhaps you could start from here: http://en.wikipedia.org/wiki/Benchmark_%28computing%29[^].

But, to be serious, you still need to start from learning CPU operation in detail and the operation of software: OS and application. I'm afraid to say, here even providing link would not immediately help: you should be able to dig into it by yourself.

For additional encouragement, please read one article I think every beginner in software engineering should read:
Peter Norvig, Teach Yourself Programming in Ten Years,
http://norvig.com/21-days.html[^].

So, if you have been successful in your learning, you already have about 10% of the progress. :-)

—SA


这篇关于C ++ Project to Benchmark A pc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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