[fpc-devel] Improving Ref Counting

Uberto Barbini uberto at ubiland.net
Sun Feb 27 13:47:25 CET 2005


> A GC needs to trace an object's references to see if anything still
> points to it. How else can it decide whether an object is no longer in use?

Yes, this is right, but it hasn't to decide if reference are valid or invalid.
Moreover also the simpliest GC techniques (mark'n'swift) are quite slow and 
are usually running in a low priority thread in background.

> I dont want a full blown GC just a way to speed up ref counting so that
> it can be used elsewhere.

Good luck, may you success where everyone else failed! ;)

> > As for me I'd rather ask for not managed Interfaces in Delphi (fpc ones
> > are ok).
>
> You already have them in Iunknown, ansistrings and variants. Its all a
> question of making them faster cause they are dog slow atm.

I wish them "NOT" managed, you cannot free a interface in Delphi.

Anyway, why you're saying that refcount is slow? Do you have any benchmark?

If I recall you mentioned try..finally as the bottleneck, but AFAIK modern cpu 
should do it almost with zero overhead, differently from try..except.

Bye Uberto

Bye Uberto




More information about the fpc-devel mailing list