Recent

Author Topic: Too many cycles  (Read 9586 times)

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Too many cycles
« Reply #30 on: September 25, 2018, 06:57:51 am »
Using Thaddy's approach with TBufStream and TFileStream makes the program 30% slower than the classic writeln(file,..) in combination with SetTextBuf().
Amazing!
Yes. That's not what I expected. It was a bit slower, but by a margin of about 4-5% on armhf. Will have to test on Intel.
Specialize a type, not a var.

bytebites

  • Hero Member
  • *****
  • Posts: 633
Re: Too many cycles
« Reply #31 on: September 25, 2018, 09:09:55 am »
WriteAnsiString writes length of the string too.

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Too many cycles
« Reply #32 on: September 25, 2018, 10:25:14 am »
IIRC from discussions the past then using TStream is not faster than good old fashioned file IO handling (assignfile,rewerite,write,closefile), given you use an optimal buffersize.

The example also shows that file IO is way slower than the other bottlenecks we percieve (like formatting to string in the inner most loop, vs outermost loop).

And still, nobody knows why TS needs this...

Bart

 

TinyPortal © 2005-2018