File tree Expand file tree Collapse file tree 2 files changed +8
-15
lines changed Expand file tree Collapse file tree 2 files changed +8
-15
lines changed Original file line number Diff line number Diff line change 1
1
SUFFIXES = .c .scm
2
2
3
- BENCH_ENVIRONMENT = LD_LIBRARY_PATH=$(srcdir ) /.libs:$(LD_LIBRARY_PATH ) \
3
+ BENCH_ENVIRONMENT = LD_LIBRARY_PATH=$(srcdir ) /.libs:$(top_builddir ) /aiscm/.libs: $( LD_LIBRARY_PATH ) \
4
4
GC_INITIAL_HEAP_SIZE=1G GC_USE_ENTIRE_HEAP=Y
5
5
6
6
EXTRA_LTLIBRARIES = libguile-aiscm-bench.la
@@ -13,7 +13,7 @@ libguile_aiscm_bench_la_LIBADD = $(GUILE_LIBS)
13
13
noinst_DATA = bench.scm
14
14
15
15
bench-local : bench.scm libguile-aiscm-bench.la
16
- $(BENCH_ENVIRONMENT ) $(GUILE ) bench.scm
16
+ $(BENCH_ENVIRONMENT ) $(GUILE ) -L $( top_builddir ) bench.scm
17
17
18
18
EXTRA_DIST = bench.scm
19
19
Original file line number Diff line number Diff line change 1
- (use-modules (oop goops)
2
- (aiscm element)
3
- (aiscm int)
4
- (aiscm pointer)
5
- (aiscm sequence)
6
- (aiscm jit)
7
- (aiscm op)
8
- (aiscm util))
1
+ (use-modules (oop goops) (aiscm core) (aiscm util) (ice-9 format))
9
2
10
3
(load-extension " libguile-aiscm-bench" " init_bench" )
11
4
30
23
(define n 1000)
31
24
(define size 250000)
32
25
(define ptr (gc-malloc-pointerless (* (size-of <int>) size)))
33
- (define <sequence<int>> (sequence <int>))
34
- (define empty (make <sequence<int>> #:size 0 ))
35
- (define s (make <sequence<int>> #:size size))
26
+ (define <sequence<int>> (multiarray <int> 1 ))
27
+ (define empty (make <sequence<int>> #:shape ' ( 0 ) ))
28
+ (define s (make <sequence<int>> #:shape ( list size) ))
36
29
(define-class <c> ())
37
30
(define-method (neg (self <c>)) self)
38
31
(define c (make <c>))
39
32
40
33
(format #t " ~32t ~10@a ~10@a ~10@a ~10@a~%" " user" " system" " total" " real" )
41
34
42
35
(run " Guile GOOPS method dispatch" n (neg c))
43
- (run " Guile make empty sequence" n (make <sequence<int>> #:size 0 ))
36
+ (run " Guile make empty sequence" n (make <sequence<int>> #:shape ' ( 0 ) ))
44
37
(run " Guile allocate memory" n (gc-malloc-pointerless (* (size-of <int>) size)))
45
38
(run " Guile negate empty sequence" n (- empty))
46
- (run " Guile make sequence" n (make <sequence<int>> #:size size))
39
+ (run " Guile make sequence" n (make <sequence<int>> #:shape ( list size) ))
47
40
(run " Guile negate sequence" n (- s))
48
41
(run " C allocate memory" n (allocation (* (size-of <int>) size)))
49
42
(run " C negate empty sequence" n (negate ptr 1 0 ))
You can’t perform that action at this time.
0 commit comments