[fpc-devel] Benchmark for FreePascal
Michael Van Canneyt
michael at freepascal.org
Mon Dec 12 11:11:45 CET 2005
On Mon, 12 Dec 2005, darekM wrote:
> Marco van de Voort napisa(a):
>
>>> On Sun, 11 Dec 2005, darekM wrote:
>>>
>>
>>
>>>> But why it is in separated unit, nobody know about it (or to few). F.e.
>>>> Lazarus has own implementation of buffering.
>>>>
>>
>> Lazarus had to do a long time with FPC 1.0.x _and_ 2.0.x. Not all artefacts
>> of that
>> transition are already banned.
>>
> I know history, Its only example, but this is small proof that no all know
> and use buffering form FPC (even if they need),
> FPC should have fastest implementation (it can).
>
>>
>>>> If we want to make faster programs, object like my should be in core
>>>> unit, then everybody use them, in other case every make own
>>>> implementation.
>>>>
>>> Maybe, but then we should put all streams in Classes, and we're not going
>>> to
>>> do that.
>>>
>>
>> Rule of thumb: specialised versions not in generically meant units, indeed.
>>
>>
> Readln is not specialized, is rather popular function, buffering version can
> be used in near all programs.
You are correct that it can and will be used in all programs.
But you are missing our main point: It should ALSO be usable for ALL
kinds of streams. Your implementation currently is limited to
file streams. My proposed solution makes it work for ALL streams,
just as the existing (de)compression/encoding/buffer/whatever streams
can be used on all streams.
So my proposal to you is to make a TTextStream = Class(TBufStream),
with no assembler code. Then, and only then, can it be included in
the FCL.
Michael.
More information about the fpc-devel
mailing list