added micro-benchmark

This commit is contained in:
Matej Sekoranja
2013-02-13 14:18:42 +01:00
parent 97b1848ba3
commit aa1a67d6c1
8 changed files with 569 additions and 1 deletions

View File

@@ -5,5 +5,6 @@ DIRS += pv
DIRS += property
DIRS += monitor
DIRS += capi
DIRS += mb
include $(TOP)/configure/RULES_DIRS

13
testApp/mb/Makefile Normal file
View File

@@ -0,0 +1,13 @@
TOP=../..
include $(TOP)/configure/CONFIG
PROD_HOST += mb_test
mb_test_CXXFLAGS += -DPV_MB
mb_test_SRCS += mb_test.cpp
mb_test_LIBS += pvData Com
include $(TOP)/configure/RULES
#----------------------------------------
# ADD RULES AFTER THIS LINE

49
testApp/mb/README Normal file
View File

@@ -0,0 +1,49 @@
channelGet
0 - client channelGet->get()
1 - client channelGet->serialize (start)
2 - client channelGet->serialize (end)
3 - server channelGet->deserialize request (start)
4 - server channelGet->deserialize request (end)
5 - server channelGet->getDone()
6 - server channelGet->serialize response (start)
7 - server channelGet->serialize response (end)
8 - client channelGet->deserialize (start)
9 - client channelGet->deserialize (end), just before channelGet->getDone() is called
MB_DECLARE_EXPORT(channelGet);
# 10000 - max size
MB_DECLARE(channelGet, 10000);
# in main() to install atexit() hook
MB_INIT;
MB_INC_AUTO_ID(channelGet);
MB_POINT(channelGet, 0);
MB_POINT(channelGet, 1);
MB_POINT(channelGet, 2);
MB_INC_AUTO_ID(channelGet);
MB_POINT(channelGet, 3);
MB_POINT(channelGet, 4);
MB_POINT(channelGet, 5);
MB_POINT(channelGet, 6);
MB_POINT(channelGet, 7);
MB_POINT(channelGet, 8);
MB_POINT(channelGet, 9);
----
cat mb* | sort < mb.csv
mb_stat mb.csv
mb_stat mb.csv -n | grep ,2, | cut -d , -f 3 | gnuplot -p -e "plot '-'"
---

17
testApp/mb/mb_test.cpp Normal file
View File

@@ -0,0 +1,17 @@
#include <iostream>
#include <pv/mb.h>
MB_DECLARE_EXTERN(test);
MB_DECLARE(test, 1000);
int main()
{
MB_INIT;
for (int i = 0; i < 10; i++)
for (int j = 0; j < 100; j++)
MB_POINT_ID(test, i, j);
return 0;
}