[Date Prev][Date Next]
- To: openldap-devel@OpenLDAP.org
- Subject: abstracting Entry
- From: Leif Johansson <firstname.lastname@example.org>
- Date: Wed, 05 Feb 2003 15:00:55 +0100
- User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130
I am working on the perl-backend and while trying to figure out a better
way to pass entries back from search operations I realise that it would
be nice if the Entry contained function pointers (under control of the
backend) instead of (or possibly using a union, as an alternative to)
data pointers. Since there is already a backend-private data blob in
there the step is not very big...
My reasoning goes something like this: When a backend returns an entry
it goes through something (str2entry for instance) which produces an
Entry. This often involves quit a bit of copying. Next the entry is
encoded for transport in send_search_entry where everything is copied
to the berbuf! By replacing direct references to data in Entry in
entry_decode (for instance) it would be relatively easy to create an
Entry type which would be more effective to pass back from backends.
In principle it should be possible to skip the encode/decode step
entierly and call backend-code directly from send_search_entry.
I am new to this list so I don't know if you have discussed this issue
before. I have done this trick before (in another server impl) and the
overhead from the extra function calls are insignifficant next to the
overhead from the extra copying.