Hi,
I am using call_user_function_ex() to call mysql_fetch_array, ocifetchinto,
etc.
error = call_user_function_ex(EG(function_table),
NULL,
&function_name_zval,
&retval, 2, ¶ms[1], 0, NULL
TSRMLS_CC);
This is not giving me the performance I am looking for because the Zend
Engine
still has to search for the function to call. Is there any way to get a
function
pointer to mysql_fetch_array/ocifetchinto etc., and call the function
directly ?
Thanks in advance.
Hi,
I am using call_user_function_ex() to call mysql_fetch_array,
ocifetchinto,
etc.error = call_user_function_ex(EG(function_table),
NULL,
&function_name_zval,
&retval, 2, ¶ms[1], 0,NULL
TSRMLS_CC);This is not giving me the performance I am looking for because the Zend
Engine
still has to search for the function to call. Is there any way to get
a
function
pointer to mysql_fetch_array/ocifetchinto etc., and call the function
directly ?
If performance is your concern, why not simply call the various RDBMS
API functions directly?
George
Hi George,
2 reasons.
High learning curve to learn all client API's. Secondly because of linking
issues with the client. E.g. oracle might not be installed on the server.
John
If performance is your concern, why not simply call the various RDBMS
API functions directly?George
Hi George,
2 reasons.
High learning curve to learn all client API's.
All the APIs have worked examples in the PHP sources. :)
Secondly because of linking
issues with the client. E.g. oracle might not be installed on the
server.
Of course you create a new runtime dependency your way.
Are you doing this for PHP5 or PHP4? There's a worked example in the
new xsl extension for PHP5 that does most of what you want (where PHP
functions are registered as XSLT extension functions.)
George
Doesn't ext/dbx already do what you're doing?
To answer your original question, no, there isn't really a way to call
it directly without duplicating a lot of ugly code.
IIRC, PHP 5 adds a cache to reduce the lookup overhead for
call_user_function; you probably won't be able to get it to go much
faster than it does already.
--Wez.
Hi George,
2 reasons.
High learning curve to learn all client API's. Secondly because of linking
issues with the client. E.g. oracle might not be installed on the server.John
Wez Furlong wrote:
Doesn't ext/dbx already do what you're doing?
To answer your original question, no, there isn't really a way to call
it directly without duplicating a lot of ugly code.
John wrote ADOdb so he is looking to speed it up.
IIRC, PHP 5 adds a cache to reduce the lookup overhead for
call_user_function; you probably won't be able to get it to go much
faster than it does already.
I'm not seeing any bottleneck there John. My bottleneck seems to come
with the result set, rather than the call, but none of it is causing a
problem yet. (Running on PHP5 of cause)
--
Lester Caine
L.S.Caine Electronic Services
Check out zend_call_function(). It allows you to cache the function lookup
in the fci_cache parameter.
Andi
At 07:17 PM 7/22/2004 +0800, John Lim wrote:
Hi,
I am using call_user_function_ex() to call mysql_fetch_array, ocifetchinto,
etc.error = call_user_function_ex(EG(function_table),
NULL,
&function_name_zval,
&retval, 2, ¶ms[1], 0,NULL
TSRMLS_CC);This is not giving me the performance I am looking for because the Zend
Engine
still has to search for the function to call. Is there any way to get a
function
pointer to mysql_fetch_array/ocifetchinto etc., and call the function
directly ?Thanks in advance.
Andi Gutmans wrote:
Check out zend_call_function(). It allows you to cache the function
lookup in the fci_cache parameter.
Where is the best place to find zend_call_function details, nothing in
the manual and google gives some spurious results.
--
Lester Caine
L.S.Caine Electronic Services
Use the source, Luke.
Andi Gutmans wrote:
Check out zend_call_function(). It allows you to cache the function
lookup in the fci_cache parameter.Where is the best place to find zend_call_function details, nothing in
the manual and google gives some spurious results.--
Lester CaineL.S.Caine Electronic Services
You can find some usage of this function in ext/standard/array.c
hth,
andrey
Quoting Lester Caine lester@lsces.co.uk:
Andi Gutmans wrote:
Check out zend_call_function(). It allows you to cache the function
lookup in the fci_cache parameter.Where is the best place to find zend_call_function details, nothing in
the manual and google gives some spurious results.--
Lester CaineL.S.Caine Electronic Services
Andrey Hristov wrote:
You can find some usage of this function in ext/standard/array.c
Where is the best place to find zend_call_function details, nothing in
the manual and google gives some spurious results.
Ta - but I'll leave this to John :)
It's a level below where I can usefully help at the moment, but since
John can't support all the database types, I may need to delve deeper in
the future. At present I don't have the tools in place to do my own
builds of PHP, so I'll stick to areas where I can ;)
--
Lester Caine
L.S.Caine Electronic Services