1 // Copyright (C) 2003-2013 Free Software Foundation, Inc.
3 // This file is part of the GNU ISO C++ Library. This library is free
4 // software; you can redistribute it and/or modify it under the
5 // terms of the GNU General Public License as published by the
6 // Free Software Foundation; either version 3, or (at your option)
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING3. If not see
16 // <http://www.gnu.org/licenses/>.
22 #include <testsuite_performance.h>
27 using namespace __gnu_test
;
30 resource_counter resource
;
32 L
"Is this the real life?\n"
33 L
"Is this just fantasy?\n"
34 L
"Caught in a landslide\n"
35 L
"No escape from reality\n"
37 L
"Look up to the skies and see\n"
38 L
"I'm just a poor boy\n"
39 L
"I need no sympathy\n"
40 L
"Because I'm easy come, easy go\n"
41 L
"Little high, little low"
42 L
"Anyway the wind blows\n"
43 L
"Doesn't really matter to me\n"
46 const size_t len
= sizeof(str
) / sizeof(str
[0]) - 1;
49 const ctype
<wchar_t>& ct
= use_facet
<ctype
<wchar_t> >(loc
);
52 wctype_t w
= wctype("space");
53 start_counters(time
, resource
);
54 for (int j
= 0; j
< 200000; ++j
)
56 for (size_t i
= 0; i
< len
; ++i
)
61 stop_counters(time
, resource
);
62 report_performance(__FILE__
, "C", time
, resource
);
63 clear_counters(time
, resource
);
66 start_counters(time
, resource
);
67 for (int j
= 0; j
< 200000; ++j
)
69 for (size_t i
= 0; i
< len
; ++i
)
71 ct
.is(ctype_base::space
, str
[i
]);
74 stop_counters(time
, resource
);
75 report_performance(__FILE__
, "C++", time
, resource
);