chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] entry/exit to Scheme really slow on Solaris


From: Bruce Hoult
Subject: [Chicken-users] entry/exit to Scheme really slow on Solaris
Date: 08 Aug 2003 15:54:09 +1200

I'm wanting to call into some relatively trivial (but important) Scheme
code many thousands of times per second.  The performance is OK on Linux
or HP/UX, but unexpectedly slow on Solaris (which is the one that matter
to me right now)

I'm trying the following trivial code which isn't what I want to
actually do, but shows the same problem:

--------------------------------------------------------
#include <stdio.h>
#include "chicken.h"

int main()
{
    int i;
    for (i=0; i<1000000; ++i){
        C_parameter p[2];
        p[0].i = 10;
        p[1].i = 7;
        CHICKEN_invoke(1, p, 2, C_toplevel);
        if (p[0].i != 17){
            printf("return value %d is not 17\n", p[0].i);
        }
    }
    return 0;
}
--------------------------------------------------------
define-entry-point 1
  ((a integer) (b integer))
  (int)
  (+ a b))
--------------------------------------------------------


The amount of time this takes on various machines is:

Athlon 1800+, RedHat 8 Linux  :  2 sec
HPPA 9000/785, HP/UX 10.20    : 29 sec
Sunfire v120, Solaris 9       : 94 sec

Based on the relative speeds of these machines running other code
(everything from Perl to my own C code) I'd expect the Sun to be a bit
over twice as fast as the HP and six or seven times slower than the
Athlon.  i.e. something around 12 - 15 seconds would be in line with my
expectations -- and would make my real application perform well.

Also, the Sun shows 25% - 30% User time, 70% - 70% kernel.  The others
show nearly zero kernel time.

-- 
Bruce Hoult <address@hidden>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]