[Libreoffice-commits] .: sal/workben
Caolán McNamara
caolan at kemper.freedesktop.org
Sat Jan 15 07:20:27 PST 2011
sal/workben/measure_oustrings.cxx | 34 +++++++++++++++++++++++++++++++---
1 file changed, 31 insertions(+), 3 deletions(-)
New commits:
commit 70f13a50282820f4449bd9564afa23a19d1bcdb9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Jan 15 15:20:17 2011 +0000
add performance comparison test for equalsAscii group
diff --git a/sal/workben/measure_oustrings.cxx b/sal/workben/measure_oustrings.cxx
index dc5fc4e..4a4e169 100644
--- a/sal/workben/measure_oustrings.cxx
+++ b/sal/workben/measure_oustrings.cxx
@@ -140,7 +140,7 @@ SAL_IMPLEMENT_MAIN()
}
#endif
- std::cout << "--Empty Strings--" << std::endl;
+ std::cout << "--Empty Strings Construction--" << std::endl;
TIME
(
@@ -154,7 +154,7 @@ SAL_IMPLEMENT_MAIN()
rtl::OUString sFoo(rtl::OUString::createFromAscii(""));
)
- std::cout << "--Single Chars--" << std::endl;
+ std::cout << "--Single Chars Construction--" << std::endl;
TIME
(
@@ -182,7 +182,7 @@ SAL_IMPLEMENT_MAIN()
rtl::OUString sFoo(rtl::OUString::createFromAscii("X"));
)
- std::cout << "--MultiChar Strings--" << std::endl;
+ std::cout << "--MultiChar Strings Construction--" << std::endl;
#ifdef SAL_DECLARE_UTF16
TIME
@@ -204,6 +204,34 @@ SAL_IMPLEMENT_MAIN()
rtl::OUString sFoo(rtl::OUString::createFromAscii("XXXXXXXXXXXXXXX"));
)
+ std::cout << "--Ascii String Comparison--" << std::endl;
+
+ rtl::OUString sCompare(RTL_CONSTASCII_USTRINGPARAM_CLASSIC("XXXXXXXXXXXXXXX"));
+
+ TIME
+ (
+ "rtl::OUString::equalsAsciiL (false)",
+ sCompare.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("apple"));
+ )
+
+ TIME
+ (
+ "rtl::OUString::equalsAscii (false)",
+ sCompare.equalsAscii("apple");
+ )
+
+ TIME
+ (
+ "rtl::OUString::equalsAsciiL(true)",
+ sCompare.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("XXXXXXXXXXXXXXX"));
+ )
+
+ TIME
+ (
+ "rtl::OUString::equalsAscii (true)",
+ sCompare.equalsAscii("XXXXXXXXXXXXXXX");
+ )
+
return 0;
}
More information about the Libreoffice-commits
mailing list