[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] inline vectors vs. srfi-9 records vs. non-inlined ve
From: |
Kon Lovett |
Subject: |
Re: [Chicken-users] inline vectors vs. srfi-9 records vs. non-inlined vectors -- or -- anything faster than srfi-9? |
Date: |
Sun, 9 Oct 2011 01:35:00 -0700 |
On Oct 8, 2011, at 6:40 PM, Matt Welland wrote:
> I'm in the habit of using inlined vector access for poor mans records:
>
> (define-inline (db:test-get-id vec) (vector-ref vec 0))
> (define-inline (db:test-get-run_id vec) (vector-ref vec 1))
> ....
>
> on the assumption that it is as fast as you can get. I'm converting some code
> to units for faster build times and obviously inline doesn't work across
> units so I looked at switching to srfi-9 records but they seem really slow. A
> simple testcase gave me the following:
>
> vectors inline: 2.94s
> vectors not inline: 6.43s
> srfi-9 records: 14.16s
>
> Is there a faster record system to use?
Someone has probably mentioned the 'record-variants' egg. The cost you are
paying w/ srfi-9 (or 'defined-record') can be see using the expand macro
facility of the csi.
>
> BTW, I'm not claiming the use of records will materially impact the
> performance of my program but I don't see much advantage to records over what
> I'm doing now and it seems that bad performance is always waiting around the
> corner to bite me so why risk it?
I certainly commiserate but why worry about it until you must. Safety first ;-)
>
> _______________________________________________
> Chicken-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/chicken-users