PIString hard optimization

This commit is contained in:
2020-07-31 14:12:47 +03:00
parent 1d5c979607
commit e728b30e5e
7 changed files with 318 additions and 258 deletions

View File

@@ -34,36 +34,25 @@ int main() {
class db {
public:
db() {
for (int i=0; i<1000; ++i)
for (int i=0; i<10000; ++i)
x << sin(double(i)/180.0);
printf("jkfkhg\n");
//printf("jkfkhg\n");
}
// db(const db & d) {x = d.x;}
// db(db && o) {x.swap(o.x);}
private:
PIVector<double> x;
};
#include "picodeparser.h"
int main() {
/*PIString s(" 324 654 sf 5fdwg sdfsdf sdfefg");
piCout << s;
piCout << s.replaceAll(' ', '1');*/
piDebug = false;
printf("==============\n");
double min = -1, max = -1, mean = 0;
for (int i = 0; i < 50; ++i) {
PICodeParser cp;
PITimeMeasurer tm;
/*PICodeParser cp;
cp.parseFile("SH_plugin_base.h");*/
PIVector<db> 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);
}
cp.parseFile("SH_plugin_base.h");
double ms = tm.elapsed_m();
if (min < 0) min = ms;
if (max < 0) max = ms;