redis: (stupid)
[personal profile] redis
Выдержка из технического описания GNU C++ STL (libstdc++):

" CString suffers from a common programming error that results in
poor performance. Consider the following code:

CString n_copies_of (const CString& foo, unsigned n)
{
CString tmp;
for (unsigned i = 0; i < n; i++)
tmp += foo;
return tmp;
}

This function is O(n^2), not O(n). The reason is that each +=
causes a reallocation and copy of the existing string. Microsoft
applications are full of this kind of thing (quadratic performance
on tasks that can be done in linear time) -- on the other hand,
we should be thankful, as it's created such a big market for high-end
ix86 hardware.
:-)

If you replace CString with string in the above function, the
performance is O(n)."

Это должно быть смешно для тех, кто поймет, о чем идет речь :)

Date: 2004-09-01 02:07 pm (UTC)
From: [identity profile] -serna-.livejournal.com
Ладно те. Компы таки начали дешеветь год назад.
А на майкрософт пинять - себя не уважать.

Profile

redis: (Default)
redis

August 2025

S M T W T F S
      12
3 4567 89
10111213141516
17181920212223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 10th, 2025 02:17 am
Powered by Dreamwidth Studios