Re: Streams



"Richard" <REMOVE AT-DOTrwskinnerAT@awesomenetDOTnet> wrote in message
news:1125406478_355@xxxxxxxxxxxxxxxxxxxxxxxxxxxx

> A little Test Program show below, once it gets over 1000 lines, it
> slows WAY down. String Streams do not seem to be the way to handle
> this, do they? It will process about 1000 strings in 0 seconds, 2000
> strings takes 20 seconds. I have to do 43200 lines.

You're probably being bitten by the stream reallocating the string it
uses for storage every time you append to it. A quick glance at the
code seems to suggest that there's no easy way to prevent that. Every
Write() truncates the contents so you can't pre-allocate the way you
can with TStringList. You'd have to write your own derived class that
doesn't truncate; it should be very little work.

Groetjes,
Maarten Wiltink


.



Relevant Pages

  • Re: Doubles and Integers as strings.
    ... cout << S1? ... you can make such string by using string streams. ... disk, string, console or any other device. ...
    (microsoft.public.vc.language)
  • Re: string to integer
    ... John Harrison wrote: ... But what do you mean by string? ... > you use stringstream classes. ... > and makes string streams useful for a lot of things besides converting ...
    (comp.lang.cpp)
  • Re: string to integer
    ... Is there built-in support for this? ... But what do you mean by string? ... can use sprintf or sscanf. ... and makes string streams useful for a lot of things besides converting ...
    (comp.lang.cpp)
  • Re: nvarchar parameter not truncated based on size of field
    ... and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ... .NETCF 1.x - Truncates parameter automatically ... "William Vaughn" wrote: ... check the size of each string before assigning? ...
    (microsoft.public.sqlserver.ce)
  • Re: nvarchar parameter not truncated based on size of field
    ... Bill, Thanks for the info. ... It's still kind of bothering me that this functionality has changed since ... ..NETCF 1.x - Truncates parameter automatically ... check the size of each string before assigning? ...
    (microsoft.public.sqlserver.ce)