Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/format/benchmark/results.txt @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 11.2 KB
Line 
1// This benchmark is provided purely for information.
2// It might not even compile as-is,
3//   or not give any sensible results.
4//      (e.g., it expects sprintf to be POSIX compliant)
5
6 new results ( with  outsstream vs. stringstream)
7
8bjam -sTOOLS="gcc intel-linux-7.1" -sBUILD="release"
9
10( -sBUILD="profile"  for profiling..)
11
12
13 "_no_reuse_stream" "_stringstr" "_strstream" _no_locale
14
15intel-linux-7.1
16
17for comp in gcc  ; do
18   echo  "\n------------------- Compiler  $comp : ---------------- "
19   for var in _overloads _basicfmt _normal; do
20     echo "\n-- Variant  **" $var "**" :
21      texe=$EXEBOOST/libs/format/benchmark/bench_format${var}/${comp}/release/bench_format${var} ;
22      ls -l $texe;
23      $texe
24   done
25done
26
27
28// stringstream recréé chaque fois.
29-- Variant  ** _normal ** :
30-rwx--x--x    1 sam      users       61952 Sep 17 03:13 /home/data/zStore/BBoost/bin/boost//libs/format/benchmark/bench_format_normal/gcc/release/bench_format_normal
31printf time         :2.16
32ostream time        : 3.69,  = 1.70833 * printf
33parsed-once time    : 8.45,  = 3.91204 * printf ,  = 2.28997 * nullStream
34reused format time  :10.94,  = 5.06481 * printf ,  = 2.96477 * nullStream
35format time         :10.97,  = 5.0787 * printf ,  = 2.9729 * nullStream
36
37
38Pour le parsing. step 1 : scan_not + str2int (version Iter const& qques % mieux)
39
40------------------- Compiler  gcc : ----------------
41
42-- Variant  ** _overloads ** :
43-rwx--x--x    1 sam      users       52864 2003-09-12 02:59 /home/sam/progs/Boost/bin/BBoost//libs/format/benchmark/bench_format_overloads/gcc/release/bench_format_overloads
44printf time         :2.21
45ostream time        : 3.57,  = 1.61538 * printf
46parsed-once time    : 4.93,  = 2.23077 * printf ,  = 1.38095 * nullStream
47reused format time  : 9.25,  = 4.18552 * printf ,  = 2.59104 * nullStream
48format time         :10.33,  = 4.67421 * printf ,  = 2.89356 * nullStream
49
50-- Variant  ** _basicfmt ** :
51-rwx--x--x    1 sam      users       52864 2003-09-12 03:00 /home/sam/progs/Boost/bin/BBoost//libs/format/benchmark/bench_format_basicfmt/gcc/release/bench_format_basicfmt
52printf time         :2.2
53ostream time        : 3.57,  = 1.62273 * printf
54parsed-once time    : 4.85,  = 2.20455 * printf ,  = 1.35854 * nullStream
55reused format time  : 9.25,  = 4.20455 * printf ,  = 2.59104 * nullStream
56format time         :10.29,  = 4.67727 * printf ,  = 2.88235 * nullStream
57
58-- Variant  ** _normal ** :
59-rwx--x--x    1 sam      users       53088 2003-09-12 03:00 /home/sam/progs/Boost/bin/BBoost//libs/format/benchmark/bench_format_normal/gcc/release/bench_format_normal
60printf time         :2.27
61ostream time        : 3.47,  = 1.52863 * printf
62parsed-once time    : 4.79,  = 2.11013 * printf ,  = 1.3804 * nullStream
63reused format time  : 9.88,  = 4.35242 * printf ,  = 2.84726 * nullStream
64format time         :10.97,  = 4.8326 * printf ,  = 3.16138 * nullStream
65
66-------------------------------------------------------------------------------------------------
67Overload : int, double char * -> put_simple :
68#if defined(BOOST_FORMAT_OVERLOADS)
69        template<class T> 
70        basic_format&   operator%(const char* x)
71            { return io::detail::feed_overloaded(*this,x); }
72        template<class T> 
73        basic_format&   operator%(const double x)
74            { return io::detail::feed_overloaded(*this,x); }
75        template<class T> 
76        basic_format&   operator%(const int x)
77            { return io::detail::feed_overloaded(*this,x); }
78#endif
79
80    // put overloads for common types (-> faster)
81    template< class Ch, class Tr, class T>
82    void put_simple( T x,
83                     const format_item<Ch, Tr>& specs,
84                     std::basic_string<Ch, Tr> & res,
85                     io::basic_outsstream<Ch, Tr>& oss_ )
86    {
87        typedef std::basic_string<Ch, Tr> string_t;
88        typedef format_item<Ch, Tr>  format_item_t;
89   
90        specs.fmtstate_.apply_on(oss_);
91        const std::ios_base::fmtflags fl=oss_.flags();
92        const std::streamsize w = oss_.width();
93     
94        if(w!=0)
95            oss_.width(0);
96        put_last( oss_, x);
97        const Ch * res_beg = oss_.begin();
98        std::streamsize res_size = std::min(specs.truncate_, oss_.pcount());
99        int prefix_space = 0;
100        if(specs.pad_scheme_ & format_item_t::spacepad)
101            if( res_size == 0 ||   ( res_beg[0] !='+' && res_beg[0] !='-'  ))
102                prefix_space = 1;
103        mk_str(res, res_beg, res_size, w, oss_.fill(), fl,
104               prefix_space, (specs.pad_scheme_ & format_item_t::centered) !=0 );
105        clear_buffer( oss_);
106    } // end- put_simple(..)
107
108
109
110------------------- Compiler  gcc : ----------------
111
112-- Variant  ** _overloads ** :
113-rwx--x--x    1 sam      users       52832 2003-09-12 00:17 /home/sam/progs/Boost/bin/BBoost//libs/format/benchmark/bench_format_overloads/gcc/release/bench_format_overloads
114printf time         :2.13
115ostream time        : 2.91,  = 1.3662 * printf
116parsed-once time    : 4.48,  = 2.10329 * printf ,  = 1.53952 * nullStream
117reused format time  : 9.42,  = 4.42254 * printf ,  = 3.23711 * nullStream
118format time         : 11.1,  = 5.21127 * printf ,  = 3.81443 * nullStream
119
120RERUN
121printf time         :2.09
122ostream time        : 2.92,  = 1.39713 * printf
123parsed-once time    : 4.43,  = 2.11962 * printf ,  = 1.51712 * nullStream
124reused format time  : 9.29,  = 4.44498 * printf ,  = 3.18151 * nullStream
125format time         :11.05,  = 5.28708 * printf ,  = 3.78425 * nullStream
126
127-- Variant  ** _basicfmt ** :
128-rwx--x--x    1 sam      users       52832 2003-09-12 00:17 /home/sam/progs/Boost/bin/BBoost//libs/format/benchmark/bench_format_basicfmt/gcc/release/bench_format_basicfmt
129printf time         :2.16
130ostream time        : 3.01,  = 1.39352 * printf
131parsed-once time    : 4.41,  = 2.04167 * printf ,  = 1.46512 * nullStream
132reused format time  : 9.61,  = 4.44907 * printf ,  = 3.19269 * nullStream
133format time         :11.02,  = 5.10185 * printf ,  = 3.66113 * nullStream
134
135-- Variant  ** _no_locale ** :
136-rwx--x--x    1 sam      users       52192 2003-09-12 00:09 /home/sam/progs/Boost/bin/BBoost//libs/format/benchmark/bench_format_no_locale/gcc/release/bench_format_no_locale
137printf time         :2.1
138ostream time        : 2.87,  = 1.36667 * printf
139parsed-once time    : 4.44,  = 2.11429 * printf ,  = 1.54704 * nullStream
140reused format time  : 8.21,  = 3.90952 * printf ,  = 2.86063 * nullStream
141format time         : 9.25,  = 4.40476 * printf ,  = 3.223 * nullStream
142
143-- Variant  ** _normal ** :
144-rwx--x--x    1 sam      users       53056 2003-09-12 00:17 /home/sam/progs/Boost/bin/BBoost//libs/format/benchmark/bench_format_normal/gcc/release/bench_format_normal
145printf time         :2.18
146ostream time        : 2.92,  = 1.33945 * printf
147parsed-once time    : 5.75,  = 2.63761 * printf ,  = 1.96918 * nullStream
148reused format time  :10.27,  = 4.71101 * printf ,  = 3.51712 * nullStream
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169------------------- Compiler  gcc : ----------------
170
171-- Variant  ** _normal ** :
172-rwx--x--x    1 sam      users       49280 2003-09-10 21:12 /home/sam/progs/Boost/bin/BBoost//libs/format/benchmark/bench_format_normal/gcc/release/bench_format_normal
173printf time         :2.16
174ostream time        : 2.81,  = 1.30093 * printf
175stored format time  :11.56,  = 5.35185 * printf ,  = 4.11388 * nullStream
176format time         :18.69,  = 8.65278 * printf ,  = 6.65125 * nullStream
177
178-- Variant  ** _static_stream ** :
179-rwx--x--x    1 sam      users       45856 2003-09-10 21:13 /home/sam/progs/Boost/bin/BBoost//libs/format/benchmark/bench_format_static_stream/gcc/release/bench_format_static_stream
180printf time         :2.1
181ostream time        : 2.79,  = 1.32857 * printf
182stored format time  :  4.5,  = 2.14286 * printf ,  = 1.6129 * nullStream
183format time         :10.05,  = 4.78571 * printf ,  = 3.60215 * nullStream
184
185-- Variant  ** _basicfmt ** :
186-rwx--x--x    1 sam      users       47200 2003-09-10 21:13 /home/sam/progs/Boost/bin/BBoost//libs/format/benchmark/bench_format_basicfmt/gcc/release/bench_format_basicfmt
187printf time         :2.22
188ostream time        : 2.88,  = 1.2973 * printf
189stored format time  : 4.45,  = 2.0045 * printf ,  = 1.54514 * nullStream
190format time         :11.67,  = 5.25676 * printf ,  = 4.05208 * nullStream
191
192
193
194
195
196The cost of imbuing locale after each object is fed :
197
198------------------- Compiler  gcc : ----------------
199-- Variant  _normal :
200-rwx--x--x    1 sam      users       49920 2003-09-10 20:23 /home/sam/progs/Boost/bin/BBoost//libs/format/benchmark/bench_format_normal/gcc/release/bench_format_normal
201printf time         :2.21
202ostream time        :  3.1,  = 1.40271 * printf
203stored format time  :11.53,  = 3.71935 * stream
204format time         :18.86,  = 6.08387 * stream
205
206-- Variant  _static_stream :
207-rwx--x--x    1 sam      users       43232 2003-09-10 20:24 /home/sam/progs/Boost/bin/BBoost//libs/format/benchmark/bench_format_static_stream/gcc/release/bench_format_static_stream
208printf time         :2.19
209ostream time        : 3.09,  = 1.41096 * printf
210stored format time  : 4.63,  = 1.49838 * stream
211format time         :10.12,  = 3.27508 * stream
212
213-- Variant  _basicfmt :
214-rwx--x--x    1 sam      users       45760 2003-09-10 20:24 /home/sam/progs/Boost/bin/BBoost//libs/format/benchmark/bench_format_basicfmt/gcc/release/bench_format_basicfmt
215printf time         :2.23
216ostream time        : 3.14,  = 1.40807 * printf
217stored format time  : 4.61,  = 1.46815 * stream
218format time         :11.33,  = 3.60828 * stream
219
220
221
222
223
224
225
226------------------- Compiler  gcc : ----------------
227-- Variant  _normal :
228printf time         :2.15
229ostream time        :4.42,  = 2.05581 * printf
230stored format time  :5.85,  = 1.32353 * stream
231format time         :11.53,  = 2.6086 * stream
232-- Variant  _no_reuse_stream :
233printf time         :2.13
234ostream time        :4.4,  = 2.06573 * printf
235stored format time  :11.1,  = 2.52273 * stream
236format time         :14.3,  = 3.25 * stream
237-- Variant  _stringstr :
238printf time         :2.01
239ostream time        :4.42,  = 2.199 * printf
240stored format time  :7.92,  = 1.79186 * stream
241format time         :12.8,  = 2.89593 * stream
242
243------------------- Compiler  intel-linux-7.1 : ----------------
244-- Variant  _normal :
245printf time         :2.08
246ostream time        :4.49,  = 2.15865 * printf
247stored format time  :5.3,  = 1.1804 * stream
248format time         :17.8,  = 3.96437 * stream
249-- Variant  _no_reuse_stream :
250printf time         :2.09
251ostream time        :4.37,  = 2.09091 * printf
252stored format time  :10.07,  = 2.30435 * stream
253format time         :14.46,  = 3.30892 * stream
254-- Variant  _stringstr :
255printf time         :1.99
256ostream time        :5.16,  = 2.59296 * printf
257stored format time  :5.83,  = 1.12984 * stream
258format time         :17.42,  = 3.37597 * stream
259
260
261
262
263// older Result with gcc-3.03 on linux :
264
265// With flag -g :
266
267/***
268printf time         :1.2
269ostream time        :2.84,  = 2.36667 * printf
270stored format time  :8.91,  = 3.13732 * stream
271format time         :15.35, = 5.40493 * stream
272format3 time        :21.83, = 7.68662 * stream
273***/
274
275
276// With flag -O
277
278/***
279printf time         :1.16
280ostream time        :1.94,  = 1.67241 * printf
281stored format time  :3.68,  = 1.89691 * stream
282format time         :6.31,  = 3.25258 * stream
283format3 time        :9.04,  = 4.65979 * stream
284***/
285
286//  ==> that's quite acceptable.
287
288// ------------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.