[fpc-devel] performance tests: reference counted vs non-reference counted

Graeme Geldenhuys graemeg.lists at gmail.com
Fri Nov 16 12:58:53 CET 2007


On 16/11/2007, Sergei Gorelkin <sergei_gorelkin at mail.ru> wrote:
> >
> Your tests do not free the refcounted objects, but free the
> non-refcounted ones. This probably explains why 'standard refcounting'
> test is faster than 'standard non-refcounting'.

Valid point, so I did that.  2 out of 3 times TInterfacedObject still
beat TObject. Using MyBaseObject stayed consistante. Non-Ref. being
faster (which would be expected result).


graemeg at graemeg:Demo_TtiBaseObject$ ./performancetest
1887748 iterations in 5 seconds (no reference counting with TObject)
1922471 iterations in 5 seconds (reference counting with TInterfacedObject)
1904732 iterations in 5 seconds (no reference counting with MyBaseObject)
1848976 iterations in 5 seconds (reference counting with MyBaseObject)

graemeg at graemeg:Demo_TtiBaseObject$ ./performancetest
1852721 iterations in 5 seconds (no reference counting with TObject)
1887200 iterations in 5 seconds (reference counting with TInterfacedObject)
1877736 iterations in 5 seconds (no reference counting with MyBaseObject)
1729770 iterations in 5 seconds (reference counting with MyBaseObject)

graemeg at graemeg:Demo_TtiBaseObject$ ./performancetest
1943921 iterations in 5 seconds (no reference counting with TObject)
1912681 iterations in 5 seconds (reference counting with TInterfacedObject)
1881897 iterations in 5 seconds (no reference counting with MyBaseObject)
1833352 iterations in 5 seconds (reference counting with MyBaseObject)



Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-devel mailing list