On Wed, 2010-03-03 at 12:32 -0500, David St-Hilaire wrote:
Bradley Lucier wrote:
It is, but I can't get benchmark.scm to run, even with a bit of hacking. Missing directories, files, getting errors in symbol-append, things like that.
This file is very old... I don't even remember writing it hehe. Please don't mind the benchmark.scm file in the class repository. If your interested about the benchmarks, they are presented in the thesis and the source code of thoses benchmarks can be found in my thesis repo: http://github.com/sthilaid/memoire/tree/master/redaction/benchmarks/
Indeed, but bench.scm has dependencies that aren't in the class git directory (or anywhere else I can find). I can't get it to run.
I redid your define-type and meroon benchmarks to (a) put the definitions in separate files that are compiled separately, and (b) use the same bench.scm file for both. I added declarations to the file bench.scm because I want fx+ and fl- to be inlined. I didn't add any declarations to the files that defined the "class"es. I also set a minimum heap of 100,000KB because I didn't want to be benchmarking Gambit's garbage collector.
I wanted to measure the speed when the "class" definitions are in a different file from the file that uses them. Maybe you wanted to measure something different.
All the files are below.
The results are:
Define-type:
heine:~/Desktop/oop-bench> gsi -:m100000 Gambit v4.6.0
(load "define-type-definitions")
"/home/lucier/Desktop/oop-bench/define-type-definitions.o2"
(load "bench")
(instance-creation .1758890151977539) (access .06786298751831055) (modif .06581807136535645) (dispatch-2 .1283562183380127) (dispatch-5 .29570913314819336) (polymorhpic-dispatch-2 .13241195678710938) (polymorhpic-dispatch-5 .29534316062927246) "/home/lucier/Desktop/oop-bench/bench.o2"
Meroon:
heine:~/Desktop/oop-bench> gsi++ -:m100000 [ Meroon V3 Paques2001+1 $Revision: 1.2 $ ] Gambit v4.6.0
(load "meroon-definitions")
"/home/lucier/Desktop/oop-bench/meroon-definitions.o2"
(load "bench")
(instance-creation .10095787048339844) (access .07755494117736816) (modif .07986021041870117) (dispatch-2 .26418304443359375) (dispatch-5 .31914305686950684) (polymorhpic-dispatch-2 .2722489833831787) (polymorhpic-dispatch-5 .39966797828674316) "/home/lucier/Desktop/oop-bench/bench.o2"
So I measure the ratio between using define-type and meroon (>1 means define-type is faster, < 1 means meroon is faster):
(instance-creation .5739862172170924) (access 1.142816489716763) (modif 1.2133477745860517) (dispatch-2 2.0582021490995888) (dispatch-5 1.0792465334831902) (polymorhpic-dispatch-2 2.0560755236092305) (polymorhpic-dispatch-5 1.3532325496726967)
So I don't see much of a speed benefit to use define-type as compared to Meroon; this is quite different from the results in your thesis, so I suspect that you measured something quite different in your thesis.
Brad