git-svn-id: svn://db.shs.com.ru/pip@840 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
57
main.cpp
57
main.cpp
@@ -28,20 +28,20 @@ PISystemMonitor sys_mon;
|
||||
class TestRec: public PIObject {
|
||||
PIOBJECT(TestRec)
|
||||
public:
|
||||
EVENT_HANDLER(void, reinitSpec) {piCout << "reinitSpec";int a = 10; (void*)&a;}
|
||||
EVENT_HANDLER(void, reinitSpec) {/*piCout << "reinitSpec";*/int a = 10; (void*)&a;}
|
||||
|
||||
EVENT_HANDLER(void, coeffsChanged) {piCout << "coeffsChanged";}
|
||||
EVENT_HANDLER(void, guiAboutSend) {piCout << "guiAboutSend";}
|
||||
EVENT_HANDLER(void, guiAfterSend) {piCout << "guiAfterSend";}
|
||||
EVENT_HANDLER(void, guiReceived) {piCout << "guiReceived";}
|
||||
|
||||
EVENT_HANDLER(void, playerReceived) {piCout << "playerReceived";int a = 10; (void*)&a;}
|
||||
EVENT_HANDLER(void, playerReceived) {/*piCout << "playerReceived";*/int a = 10; (void*)&a;}
|
||||
|
||||
EVENT_HANDLER(void, playerValuesReceived) {piCout << "playerValuesReceived";}
|
||||
EVENT_HANDLER(void, calculate) {piCout << "calculate";}
|
||||
EVENT_HANDLER(void, autostart) {piCout << "autostart";}
|
||||
|
||||
EVENT_HANDLER(void, syncOff) {piCout << "syncOff";int a = 10; (void*)&a;}
|
||||
EVENT_HANDLER(void, syncOff) {/*piCout << "syncOff";*/int a = 10; (void*)&a;}
|
||||
|
||||
EVENT_HANDLER(void, del) {piCout << "DEL";}
|
||||
};
|
||||
@@ -77,7 +77,12 @@ class CC: public CB {
|
||||
};
|
||||
|
||||
#define CONN(sn) CONNECTU(snd, sn, rec, sn)
|
||||
|
||||
uint HashLy(const void* d, int l) {
|
||||
uint hash = 0u;
|
||||
for(int i = 0; i < l; ++i)
|
||||
hash = (hash * 1664525u) + ((uchar*)d)[i] + 1013904223u;
|
||||
return hash;
|
||||
}
|
||||
int main(int argc, char * argv[]) {
|
||||
//sys_mon.startOnSelf();
|
||||
|
||||
@@ -106,7 +111,7 @@ int main(int argc, char * argv[]) {
|
||||
CONN(syncOff);
|
||||
|
||||
// 0.6 us on call
|
||||
/*for (int j = 0; j < 10; ++j) {
|
||||
for (int j = 0; j < 10; ++j) {
|
||||
tm.reset();
|
||||
for (int i = 0; i < 10000; ++i) {
|
||||
snd->reinitSpec();
|
||||
@@ -115,11 +120,45 @@ int main(int argc, char * argv[]) {
|
||||
}
|
||||
double el = tm.elapsed_m();
|
||||
piCout << el;
|
||||
}*/
|
||||
piCout << "****";
|
||||
PIPeer().dump();
|
||||
piCout << "----";
|
||||
}
|
||||
|
||||
/*piCout << "****";
|
||||
PIPeer().dump();
|
||||
piCout << "----";*/
|
||||
|
||||
/* PIString _s = "012345678901234567890123456789";
|
||||
CRC_32 crc = standardCRC_32();
|
||||
PIByteArray _sd = _s.toByteArray();
|
||||
double el;
|
||||
uint ret;
|
||||
|
||||
tm.reset();
|
||||
for (int i = 0; i < 1000000; ++i) {
|
||||
ret = crc.calculate(_sd.data(), _sd.size_s());
|
||||
}
|
||||
el = tm.elapsed_m();
|
||||
piCout << "";
|
||||
piCout << ret;
|
||||
piCout << "crc" << el;
|
||||
|
||||
tm.reset();
|
||||
for (int i = 0; i < 1000000; ++i) {
|
||||
ret = HashLy(_sd.data(), _sd.size_s());
|
||||
}
|
||||
el = tm.elapsed_m();
|
||||
piCout << "";
|
||||
piCout << ret;
|
||||
piCout << " ly" << el;
|
||||
|
||||
tm.reset();
|
||||
for (int i = 0; i < 1000000; ++i) {
|
||||
ret = murmur3_32((const uchar*)_sd.data(), _sd.size_s());
|
||||
}
|
||||
el = tm.elapsed_m();
|
||||
piCout << "";
|
||||
piCout << ret;
|
||||
piCout << "mur" << el;
|
||||
*/
|
||||
delete snd;
|
||||
delete rec;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user