chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] inline vectors vs. srfi-9 records vs. non-inlined vector


From: Matt Welland
Subject: [Chicken-users] inline vectors vs. srfi-9 records vs. non-inlined vectors -- or -- anything faster than srfi-9?
Date: Sat, 8 Oct 2011 18:40:05 -0700

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?

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?


reply via email to

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