问题描述
我需要对用 C++ 编写的库进行性能测试.该库由几组结构组成.我已经对这些类进行了序列化测试,但不确定如何对这些类进行性能测试.下面是库中结构的示例
如果提供任何示例,那将非常好.
好的,所以我在类型中添加了序列化(你为什么省略它?)
现在,使用
<小时>测试fixture其实做的工作比较多,定义如下:
完整代码清单
在 Coliru
I need to do performance testing of a library written in c++. The library consist of few sets of structures. I have already done the serialization test for these class but not sure how to do perfomance test for these . Below is sample of a struct in library
If any example is provided then it will be really good.
Okay, so I added serialization to the types (why did you leave it out?)
And now, using the Nonius benchmarking mini-framework, write the following benchmarks:
The raw output is (for a fixture of 1000 random X and 3000 random Y values):
Interactive plot: click here
The test fixture is actually a lot more work, and is defined as follows:
Full Code Listing
On Coliru
这篇关于如何使用自定义库的 boost 库进行性能测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!