Skip to content

Commit 34d31a7

Browse files
committed
Get benchmarks working again
1 parent 7d1c4e8 commit 34d31a7

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

bench/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SUFFIXES = .c .scm
22

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) \
44
GC_INITIAL_HEAP_SIZE=1G GC_USE_ENTIRE_HEAP=Y
55

66
EXTRA_LTLIBRARIES = libguile-aiscm-bench.la
@@ -13,7 +13,7 @@ libguile_aiscm_bench_la_LIBADD = $(GUILE_LIBS)
1313
noinst_DATA = bench.scm
1414

1515
bench-local: bench.scm libguile-aiscm-bench.la
16-
$(BENCH_ENVIRONMENT) $(GUILE) bench.scm
16+
$(BENCH_ENVIRONMENT) $(GUILE) -L $(top_builddir) bench.scm
1717

1818
EXTRA_DIST = bench.scm
1919

bench/bench.scm

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
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))
92

103
(load-extension "libguile-aiscm-bench" "init_bench")
114

@@ -30,20 +23,20 @@
3023
(define n 1000)
3124
(define size 250000)
3225
(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)))
3629
(define-class <c> ())
3730
(define-method (neg (self <c>)) self)
3831
(define c (make <c>))
3932

4033
(format #t "~32t ~10@a ~10@a ~10@a ~10@a~%" "user" "system" "total" "real")
4134

4235
(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)))
4437
(run "Guile allocate memory" n (gc-malloc-pointerless (* (size-of <int>) size)))
4538
(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)))
4740
(run "Guile negate sequence" n (- s))
4841
(run "C allocate memory" n (allocation (* (size-of <int>) size)))
4942
(run "C negate empty sequence" n (negate ptr 1 0))

0 commit comments

Comments
 (0)