Re: php extension for lib Judy
| From: | Antony Dovgal | Date: | Fri, 17 Sep 2010 07:17:45 +0000 |
| Subject: | Re: php extension for lib Judy | ||
| References: | 1 2 3 4 5 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-7647@lists.php.net to get a copy of this message | ||
On 09/17/2010 09:17 AM, Nicolas Brousse wrote:
>> Also I don't quite see any point in calling methods with
>> zend_call_method_with_X_params()
>> if these very methods are defined several lines above - you can just move the body of the
>> method to an internal function and call it directly, not through ZE API (that would also
>> buy you some more performance).
>
> I wasn't sure on this. At first, I thought it would make the code
> cleaner/easier to read.
It definitely doesn't make the code any clearer and you lose the precious performance gained by
using Judy itself.
>> You should also prevent calling __construct() several times, from what I can see atm it
>> results in a memleak.
>
> I'm not sure I understand this. Do you mean preventing the user from
> doing $myobject->__construct() ?
Yes.
"$o = new Class" is ok, but calling __construct() directly should not be
allowed since you do some initialization there.
--
Wbr,
Antony Dovgal
---
http://pinba.org - realtime statistics for PHP