Re: Converting int to string
From: tom_usenet (tom_usenet_at_hotmail.com)
Date: 08/09/04
- Next message: Christian Brunner: "map < string , map < string, int > > leads to internal compiler error"
- Previous message: Igor Tandetnik: "Re: Nested CArray"
- In reply to: r norman: "Re: Converting int to string"
- Next in thread: Russell Hind: "Re: Converting int to string"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 09 Aug 2004 16:38:48 +0100
On Mon, 09 Aug 2004 08:52:26 -0400, r norman <rsn_@_comcast.net>
wrote:
><snip code which probably exhibits these characteristics>
>
>I would bet that if you spent as much time analyzing and refining the
>design of your program as you did in creating this example, you would
>get far better performance out of your overall program. It is probably
>a very rare and exceptional program in which converting int to string
>is the major determinant of performance. Therefore pulling even an
>inefficient package out of the standard library is probably the most
>efficient and effective technique from the perspective of getting the
>entire application done correctly.
When building library components for general consumption, you are not
targetting a specific program, and since you don't know the
performance requirements of the programs your library will be used
with, you have to assume the worst.
(e.g. Andrei Alexandrescu wrote:
"Often, a library writer doesn't know exactly how that library will be
used. The library might be used for mild tasks or in a speed-hungry
context. While a fast library can be used for mellow stuff, a slow
library can't be used in inner loops. My opinion in the matter is:
bottom line, a library writer's duty is to offer as good a set of
tradeoffs as possible.")
If you are writing an application and don't have conv::itoa (or
similar) available, you should of course use the standard library
functions until such time as profiling shows them to be too slow
(which will likely be never). At that point you go looking for a
faster solution, resorting to writing your own only if you can't find
an off the shelf solution.
Tom
- Next message: Christian Brunner: "map < string , map < string, int > > leads to internal compiler error"
- Previous message: Igor Tandetnik: "Re: Nested CArray"
- In reply to: r norman: "Re: Converting int to string"
- Next in thread: Russell Hind: "Re: Converting int to string"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|