At 12:03 AM 4/27/2001 -0400, David Croft wrote:

>Thank you Andi and Andrei.
>I have noticed that object method callbacks are consistently faster than
>global function callbacks, and was wondering why:
>1.3135770559311 seconds for 100000 runs - with no function callback
>6.9758139848709 seconds for 100000 runs - with object method callback
>7.9048730134964 seconds for 100000 runs - with global function callback
>This is somewhat strange for me as I would expect objects to be slower if
>it has to look up the class and then locate the function table?

No idea. The global function's should be faster.

>I'm exploring hashes now. I find code like this in php_imap.c:
>         if (zend_hash_find(Z_ARRVAL_PP(envelope), "remail",
>sizeof("remail"), (void **) &pvalue)== SUCCESS) {
>                 convert_to_string_ex(pvalue);
>                 env->remail=cpystr(Z_STRVAL_PP(pvalue));
>         }
>Is that legal? It seems that it would alter the original array by forcing
>conversion to string.

It really depends what was put in the hash and the semantics of the code. 
I'd have to read the code to understand what is being done there.

>Lastly, I am trying to see the difference between zend_hash_find and
>zend_hash_quick_find. Would I be correct in assuming quick_find only looks
>at string keys, and it would be safe to use this if the function expects
>only associative arrays?

quick_find() is also passed the hash value so it saves a tiny amount of 
time by not having to compute the hash value of the string. I'm not sure 
how much this really helps.


PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to