guile-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Performance improvement for R6RS records


From: Andy Wingo
Subject: Re: [PATCH] Performance improvement for R6RS records
Date: Sun, 19 Sep 2010 12:39:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Hi Julian,

On Sun 19 Sep 2010 02:20, Julian Graham <address@hidden> writes:

>    (define (record-internal? obj)
> -    (and (struct? obj)
> -      (let* ((vtable (struct-vtable obj))
> -             (layout (symbol->string
> -                      (struct-ref vtable vtable-index-layout))))
> -        (and (>= (string-length layout) 4)
> -             (let ((rtd (struct-ref obj record-index-rtd)))
> -               (and (record-type-descriptor? rtd)))))))
> +    (and (struct? obj) (eq? (struct-vtable obj) record-vtable)))

Is it possible to keep the current flat record layout, and change this
check to be:

  (define (record-internal? obj)
    (and (struct? obj)
         (eq? (struct-vtable (struct-vtable obj))
              record-type-vtable)))

What kind of performance do you get there?

Andy
-- 
http://wingolog.org/



reply via email to

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