L505 wrote:
>>> Very nice compact stringlist in there to use...
>>> Standard Classes stringlist adds about 60K-70K to your exe/elf while 
>>> CompactUtils
>>> PStrList only adds maybe 1-5KB.
>> Please compare what is comparable:
>>
>> The Classes unit contains more than just the TStringlist and TList.
>>
>> It contains a whole lot of other classes as well: streams, collections,
>> components, threads, and the whole streaming system. All things which
>> are commonly used in Object Pascal programs.
> 
> KOL contains Streams, Threads, Stringlists,  TLists (actually PList) and 
> almost every
> single function implmented in the Classes unit. They are pretty comparable. 
> (CompactUtils
> doesn't contain threads yet because I didn't work on that area - just not 
> enought time.).
> 

KOL isn't comparable with the FCL. KOL has no real error handling just
one example:

//[function TList.Get]
function TList.Get( Idx: Integer ): Pointer;
begin
   Result := nil;
   if Idx < 0 then Exit;
   if Idx >= fCount then Exit;
   Result := fItems[ Idx ];
end;

function TFPList.Get(Index: Integer): Pointer; {$ifdef CLASSESINLINE}
inline; {$endif CLASSESINLINE}
begin
  If (Index < 0) or (Index >= FCount) then
    RaiseIndexError(Index);
  Result:=FList^[Index];
end;

KOL simply exits, the FCL throws a proper exception with an error
message with a text. The error message probably adds more size to the
executable than the whole get function. KOL doesn't offer the same
functionality as the FCL. It's the price for the smaller size.

When buying hardware, you can only get two of the three:
speed, quality, price
When writing a compiler, you can get only two of the three:
speed, little memory usage, maintainability
When writing a library, you've to choose two of
speed, size, function
It's always a trade off. Neither KOL nor FCL is better, they are simply
designed different and comparsion is useless.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to