[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MIT-Scheme-users] Query about compiled code
From: |
Matt Birkholz |
Subject: |
Re: [MIT-Scheme-users] Query about compiled code |
Date: |
Mon, 6 Mar 2006 12:57:42 -0700 |
> From: "Amey Karkare" <address@hidden>
> Date: Mon, 6 Mar 2006 17:00:43 +0530
>
> [...]
>
> This is a possibility. However I thought it will be better -
> performance wise - if I could modify the C-routine directly. I am
> still a newbie to Scheme/mit-scheme and not very sure if modifying C
> will actually be faster than modifying user program.
The car primitive is often compiled in-line -- just a machine
instruction or three. If performance of the metered program is the
issue, you might get by with an in-lined fixnum-increment primitive
(3-4 instructions?) alongside every in-lined car primitive. Again, to
do that, modify your definition of "car" (not the user program).
> > Who-all's use of car and cdr do you want to measure? Surely not the
> > whole system... ?
> No, only the user program's.
And any library routines (e.g. append) it calls? If so, they will
need to be compiled for your modified "car" too.