From 692840565d0cac3e60f4ba484bf48dfe49f9e862 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 15 Jan 2011 15:20:17 +0000 Subject: add performance comparison test for equalsAscii group --- sal/workben/measure_oustrings.cxx | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) (limited to 'sal/workben') diff --git a/sal/workben/measure_oustrings.cxx b/sal/workben/measure_oustrings.cxx index dc5fc4e75584..4a4e169deffa 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; } -- cgit