Re: [RFC] Internal operator overloading and GMP improvements
| From: | Dmitry Stogov | Date: | Tue, 14 May 2013 05:43:15 +0000 |
| Subject: | Re: [RFC] Internal operator overloading and GMP improvements | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-67423@lists.php.net to get a copy of this message | ||
Hi Nikita,
Few final notes:
- I wouldn't change zend_object_compare_t into
zend_object_compare_objects_t. It would be better to name the new function
as zend_object_compare_zvals_t. (It's just for better backward
compatibility)
- Increment and decrement operators in PHP may have different semantic than
+=1, but I it's probably OK to use ADD/SUB for them.
- In some cases you insert call to zend_object_do_operation into the most
probable path (e.g. in mod_function). This would cause at lease 2
additional comparisons and may be conditional jumps. I think it would be
better to check for most probable operand types first...
I didn't look into GMP part.
Thanks. Dmitry.
On Mon, May 13, 2013 at 8:16 PM, Nikita Popov <nikita.ppv@gmail.com> wrote:
> On Mon, May 13, 2013 at 1:09 PM, Dmitry Stogov <dmitry@zend.com> wrote:
>
>> Hi Nikita,
>>
>> I didn't get why do we need separate zend_std_compare() function.
>> May be I just didn't look careful :)
>>
> Good point, that was not really necessary. I moved the code back into
> compare_function.
>
>
>> It would be great to look into the patch between master and current of
>> your branch.
>>
> You can find a diff between master and my branch on the PR:
> https://github.com/php/php-src/pull/342/files
> The relevant diff for the compare handler is here:
> https://github.com/php/php-src/pull/342/files#L2R1581
>
> Nikita
>