#include "pip.h" /*#ifdef PIP_LUA #include "piluaprogram.h" static const char * script = "-- script.lua \n" "test()\n" "testString = \"LuaBridge works ававава!\" \n" "number = 42 \n"; void test() { piCout << "C function test"; } int main() { PILuaProgram p; p.getGlobalNamespace().addFunction("test", test); if (!p.load(PIString::fromUTF8(script))) piCout << "error"; p.prepare(); luabridge::LuaRef s = p.getGlobal("testString"); luabridge::LuaRef n = p.getGlobal("number"); PIString luaString = s.cast(); int answer = n.cast(); piCout << luaString; piCout << "And here's our number:" << answer; } #else int main() { return 0; } #endif */ class db { public: db() { for (int i=0; i<1000; ++i) x << sin(double(i)/180.0); printf("jkfkhg\n"); } // db(const db & d) {x = d.x;} // db(db && o) {x.swap(o.x);} private: PIVector x; }; #include "picodeparser.h" int main() { piDebug = false; printf("==============\n"); double min = -1, max = -1, mean = 0; for (int i = 0; i < 50; ++i) { PITimeMeasurer tm; /*PICodeParser cp; cp.parseFile("SH_plugin_base.h");*/ PIVector sl; sl.reserve(10000); db d; for (int i = 0; i < 10000; ++i) { // db b(d); // db c(b); // c = b; // sl << c; sl << db(d); // sl << std::move(d); } double ms = tm.elapsed_m(); if (min < 0) min = ms; if (max < 0) max = ms; min = piMin(min, ms); max = piMax(max, ms); mean += ms; } piDebug = true; piCout << min << (mean / 50) << max; }