Indeed.  I'm just trying to think if there's a way that that can be implemented in a cross-platform way, or if there's a wa to identify if a generic type is a pointer/managed type.


On 25/11/2022 16:00, Stefan Glienke via fpc-devel wrote:
>From experience I can tell that IntroSort is fast enough.

The main performance improvement usually comes from treating anything that is a 
managed type such as strings as Pointers - instead of three string assignments 
that cause a bunch of unnecessary atomic operations you then just have 3 
pointer assignments. And with anything inside of IntroSort there are just swaps 
that can go without any reference counting.

On 24/11/2022 19:51 CET J. Gareth Moreton via fpc-devel 
<> wrote:

Hi everyone,

I just need to touch on the knowledge base.  What tests exist that test
the functionality of rtl/inc/sortbase.pp?  As Olly suggested, I'm
looking at creating Introsort for this unit as well, but I need to know
if such a unit already exists or if I need to make my own.

Also, since Olly mentioned that the unit is used in TStringList, it
makes me wonder if the RTL has a radix sort algorithm available, since
radix sort is on the order of O(n) and is ideal for sorting large arrays
of strings (although it can be memory-intensive).


fpc-devel maillist  -
fpc-devel maillist  -

fpc-devel maillist  -

Reply via email to