Re: Converting int to string

From: tom_usenet (tom_usenet_at_hotmail.com)
Date: 08/09/04


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



Relevant Pages

  • Point taken (Was Re: ADVERT: Secure communications)
    ... comment by experienced cryptanalysts on the L15 algorithm. ... Why would I spend my time analyzing an algorithm designed ... cryptosystem design and evaluation? ... Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org ...
    (sci.crypt)
  • Re: ADVERT: Secure communications
    ... comment by experienced cryptanalysts on the L15 algorithm. ... Not a chance! ... Why would I spend my time analyzing an algorithm designed ... cryptosystem design and evaluation? ...
    (sci.crypt)
  • Re: Quiet Airliners of the Future?
    ... required to engineer these systems have spent significantly more time analyzing their design than I am willing to commit. ... Stefan ...
    (rec.aviation.piloting)