Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> OCI performance with user callbacks

OCI performance with user callbacks

From: roger <rsr_at_rogerware.com>
Date: Mon, 06 Jan 2003 19:05:02 GMT
Message-ID: <Xns92FB70E521D8Drsrrogerwarecom@204.127.199.17>


Hi. Has anyone using OCI "user callbacks" noticed that the performance of your OCI application drops off *dramatically* when these are used? Or is it just me?

For example, I'm doing this:

// provide a *trivial* user defined callback sword ocicb (dvoid *ctx, dvoid *hndl, ub4 type, ub4 fcode, ub4 when,

                 sword retcode, int *errnop, va_list args)
{

  return retcode;
}

// register entry/exit callbacks for just a few OCI functions int fcodes[] = {

   OCI_FNCODE_LOGON, OCI_FNCODE_LOGOFF,
   OCI_FNCODE_STMTEXECUTE,
   OCI_FNCODE_STMTFETCH,

   0
};

for (int i=0; fcodes[i]; i++)
{

   OCIUserCallbackRegister (envp, OCI_HTYPE_ENV, errp,

                 ocicb, 0, fcodes[i], OCI_UCBTYPE_ENTRY, 0);    OCIUserCallbackRegister (envp, OCI_HTYPE_ENV, errp,

                 ocicb, 0, fcodes[i], OCI_UCBTYPE_EXIT, 0); }

Now, when I do this, I observe that the performance of my application (measured by my own benchmarking means) drops by about 15%, which actually understates the impact significantly, because the OCI processing accounts for only a fraction of the total time being measured.

In the OCI programmer's guide, it talks about the use of user callbacks to do things such as insert performance monitoring code (which is one of the things I had in mind to do use them for). But, if they are this expensive to call, then I can't use them at all.

Anyone else have any experience with this.

Also, note in my callbacks that I am returning the value of the retcode parameter that was passed into the function. I am presuming that this is the correct thing to do if one is attempting to implement some sort of "passive" processing, and not affect OCI's behavior.
Right?

Thanks.
roger Received on Mon Jan 06 2003 - 13:05:02 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US