summaryrefslogtreecommitdiff
path: root/libguile/srfi-60.h
diff options
context:
space:
mode:
authorDaniel Llorens <daniel.llorens@bluewin.ch>2015-02-13 18:42:27 +0100
committerDaniel Llorens <daniel.llorens@bluewin.ch>2016-07-11 09:11:50 +0200
commitc17799dda915dab93142c76bda9152d25919cb49 (patch)
treea5f835dc200bd0438854f7d112b61bfdabfbc188 /libguile/srfi-60.h
parent348d8b46b0fa24d65eb6e4008b32fb725d7ec3f1 (diff)
downloadguile-c17799dda915dab93142c76bda9152d25919cb49.tar.gz
Speed up for multi-arg cases of scm_ramap functions
This patch results in a 20%-40% speedup in the > 1 argument cases of the following microbenchmarks: (define A (make-shared-array #0(1) (const '()) #e1e7)) ; 1, 2, 3 arguments. (define a 0) ,time (array-for-each (lambda (b) (set! a (+ a b))) A) (define a 0) ,time (array-for-each (lambda (b c) (set! a (+ a b c))) A A) (define a 0) ,time (array-for-each (lambda (b c d) (set! a (+ a b c d))) A A A) (define A (make-shared-array (make-array 1) (const '()) #e1e7)) (define B (make-shared-array #0(1) (const '()) #e1e7)) ; 1, 2, 3 arguments. ,time (array-map! A + B) ,time (array-map! A + B B) ,time (array-map! A + B B B) * libguile/array-map.c (scm_ramap): note on cproc arguments. (rafill): assume that dst's lbnd is 0. (racp): assume that src's lbnd is 0. (ramap): assume that ra0's lbnd is 0. When there're more than two arguments, compute the array handles before the loop. Allocate the arg list once and reuse it in the loop. (rafe): like rafe, when there's more than one argument. (AREF, ASET): remove.
Diffstat (limited to 'libguile/srfi-60.h')
0 files changed, 0 insertions, 0 deletions