Re: [fpc-pascal] try..finally vs interfaces performance

2016-04-14 Thread Graeme Geldenhuys
On 2016-04-14 21:45, Luiz Americo Pereira Camara wrote: > other class > that implements addref method but does not automatically frees the instance > when refcount is zero I always considered that a bit of a hack. But yes, you are right. Regards, Graeme

Re: [fpc-pascal] try..finally vs interfaces performance

2016-04-14 Thread Luiz Americo Pereira Camara
2016-04-14 10:58 GMT-03:00 Graeme Geldenhuys : > On 2016-04-14 14:15, Marcos Douglas wrote: > > because you gain more than just automatic memory release. > > It is also worth noting that not all Interface usage means “automatic > memory release”. If you use

Re: [fpc-pascal] try..finally vs interfaces performance

2016-04-14 Thread Vincent Snijders
2016-04-14 10:50 GMT+02:00 Michael Van Canneyt : > > > On Thu, 14 Apr 2016, Mazola Winstrol wrote: > > Recently i did some maintenance in a code of a colleague. I realized that >> he designed several classes with interface support so he do not need to >> protect the code

Re: [fpc-pascal] try..finally vs interfaces performance

2016-04-14 Thread Marcos Douglas
On Thu, Apr 14, 2016 at 10:58 AM, Graeme Geldenhuys wrote: > On 2016-04-14 14:15, Marcos Douglas wrote: >> because you gain more than just automatic memory release. > > It is also worth noting that not all Interface usage means “automatic > memory release”. If you

Re: [fpc-pascal] try..finally vs interfaces performance

2016-04-14 Thread Graeme Geldenhuys
On 2016-04-14 14:15, Marcos Douglas wrote: > because you gain more than just automatic memory release. It is also worth noting that not all Interface usage means “automatic memory release”. If you use COM-style Interfaces, then yes you get memory management. If you use CORBA-style Interface, then

Re: [fpc-pascal] try..finally vs interfaces performance

2016-04-14 Thread Marcos Douglas
On Thu, Apr 14, 2016 at 5:19 AM, Mazola Winstrol wrote: > Recently i did some maintenance in a code of a colleague. I realized that he > designed several classes with interface support so he do not need to protect > the code blocks with try..finally to ensure that the

Re: [fpc-pascal] try..finally vs interfaces performance

2016-04-14 Thread Michael Van Canneyt
On Thu, 14 Apr 2016, Mazola Winstrol wrote: Recently i did some maintenance in a code of a colleague. I realized that he designed several classes with interface support so he do not need to protect the code blocks with try..finally to ensure that the instances are released from memory.

Re: [fpc-pascal] try..finally vs interfaces performance

2016-04-14 Thread Graeme Geldenhuys
On 2016-04-14 09:19, Mazola Winstrol wrote: > Theoretically, which solution has higher performance? Interesting question. As for the answer I have no idea. Why don't you put a quick test together. Loop the code 10,000 or 100,000 times and time the results. Please share your test code and answer

[fpc-pascal] try..finally vs interfaces performance

2016-04-14 Thread Mazola Winstrol
Recently i did some maintenance in a code of a colleague. I realized that he designed several classes with interface support so he do not need to protect the code blocks with try..finally to ensure that the instances are released from memory. Theoretically, which solution has higher performance?