apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <mt...@apache.org>
Subject Poor performance with new apr_pool
Date Thu, 26 Mar 2009 11:29:35 GMT
Just did some quick bench of the current trunk,
and the results are not very much encouraging.

static void test_performance(abts_case *tc, void *data)
     apr_status_t rv;
     int i;
     void *m;
     apr_time_t end, now = apr_time_now();

     for (i = 0; i < 1000000; i++) {
         apr_pool_t *p;

         apr_pool_create(&p, NULL);
         m = apr_palloc(p, 1234);

     end = apr_time_now();

     printf("\n\nFinished in %ld\n", end - now);


Apr 1.4
Finished in 371490

Apr trunk
Finished in 1359345

So the trunk takes almost 4 times longer to finish!

I thought that the problem might be the fact that
each pool creates its own mutex, well if I
#if 0
                                   APR_THREAD_MUTEX_NESTED, pool);
inside apr_pool_create_ex, the results are better
Finished in 798145

However this is still twice slower!

Tests performed on
Linux 2.6.18-92.1.13.el5 #1 SMP Thu Sep 4 03:51:01 EDT 2008 i686 i686 i386 GNU/Linux


View raw message