PIString benchmarks
This commit is contained in:
28
main.cpp
28
main.cpp
@@ -110,5 +110,33 @@ int main(int argc, char * argv[]) {
|
||||
l = s.size();
|
||||
}
|
||||
piCout << l << "PIString::fromAscii" << tm.elapsed_m();
|
||||
PIString is = PIString::fromAscii(bigstr);
|
||||
tm.reset();
|
||||
for(int i=0; i<cc; ++i) {
|
||||
l = is.toByteArray().size();
|
||||
}
|
||||
piCout << l << "PIString::toByteArray" << tm.elapsed_m();
|
||||
PIByteArray ba = is.toByteArray();
|
||||
tm.reset();
|
||||
for(int i=0; i<cc; ++i) {
|
||||
PIString s = PIString::fromUTF8(ba);
|
||||
l = s.size();
|
||||
}
|
||||
piCout << l << "PIString::fromByteArray" << tm.elapsed_m();
|
||||
tm.reset();
|
||||
for(int i=0; i<cc; ++i) {
|
||||
PIString s = PIString::fromNumber(ba.size());
|
||||
l = s.size();
|
||||
}
|
||||
piCout << l << "PIString::fromNumber" << tm.elapsed_m();
|
||||
tm.reset();
|
||||
PIString is2 = PIString::fromUTF8(ba);
|
||||
for(int i=0; i<cc; ++i) {
|
||||
PIString s = is;
|
||||
l = s.size();
|
||||
s = is2;
|
||||
l += s.size();
|
||||
}
|
||||
piCout << l << "PIString::assign non empty" << tm.elapsed_m();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user