On Tue, Mar 01, 2011 at 01:20:20PM +0100, Stefan Küng wrote: > Let me illustrate this a little bit: > Assume: 1M properties in 100k folders > svn_proplist recursive. > Callback called 100k times > for every callback: > - svn lib allocates memory for the data > - calls callback function, passes data > - UI client receives the data, copies the data to big memory buffer > - svn lib deallocates memory for data > > memory allocations/deallocations are slow, especially in > multi-threaded processes (meaning: not big of a problem for the CL > client but for UI clients). > In this scenario, there are 100k allocations and deallocations which > could get reduced to one big allocation and one deallocation.
Oh, I see. If the overhead of copying between buffers hurts performance that much, we can provide an API that passes a buffer to the application. It would be interesting to implement this for proplist and then perform measurements to see if it really makes that much of a difference. Proplist is just one example where we need to pull data out of the DB and give it to library callers. I anticipate additional APIs that use the callback-passing approach in the future, so any insights gained while experimenting with proplist will help.