Shlib Subroutine         Source File                  Ratio Enter  % Cycles
================         ===========                  ===== ===== ==========
.memset                  memset.s                      5.63 9     6.3 15311

Hummm... here is a snip from the flow trace...

<snip>
1003923 2689   sendrecv.c                   99     17   .......[0]apr_recv
1003925 2703   sendrecv.c                   119    14
........[0]apr_wait_for_io_or_timeout
1003927 2709   glink.s                      185    6    .........[0]bzero
1003928 2712   memset.s                     29     3    .........[0]bzero
1003929 4785   memset.s                     10326  2073 .........*[0]memset
1004959 4803   sendrecv.c                   65     18
........[14]apr_wait_for_io_or_timeout
1004961 4809   glink.s                      128    6    .........[0]__divi64
1004962 4908   divi64.s                     295    99   .........[0]__divi64
1004982 4917   sendrecv.c                   13     9
........[32]apr_wait_for_io_or_timeout
1004983 4923   glink.s                      83     6    .........[0]select
==> KERNEL
</snip>

Here is the source that corresponds to the flow trace:

apr_status_t apr_wait_for_io_or_timeout(apr_socket_t *sock, int for_read)
{
    struct timeval tv, *tvptr;
    fd_set fdset;
    int srv;

    do {
        FD_ZERO(&fdset);
        FD_SET(sock->socketdes, &fdset);
        if (sock->timeout < 0) {
            tvptr = NULL;
        }
        else {
            tv.tv_sec = sock->timeout / APR_USEC_PER_SEC;
            tv.tv_usec = sock->timeout % APR_USEC_PER_SEC;
            tvptr = &tv;
        }
        srv = select(sock->socketdes + 1,
            for_read ? &fdset : NULL,
            for_read ? NULL : &fdset,
            NULL,
            tvptr);
        /* TODO - timeout should be smaller on repeats of this loop */
    } while (srv == -1 && errno == EINTR);

I am -very- suprised that FD_SET is so wicked expensive. This accounts for
10,000+ of the 15,311 cycles of memset. Going to bounce this one off the AIX
dev team and see what I get back.

Bill

Reply via email to