[gambit-list] code optimization & compilation
Guillaume Lathoud
glathoud at yahoo.fr
Tue Apr 9 00:36:00 EDT 2013
Hello,
on a simple task - multiply two matrices mat_a and mat_b https://github.com/glathoud/flatorize/blob/master/explore/scheme_matmul_common.scm - I've been comparing 3 implementations, using interpretation and compilation.
To compile I used the line below. Is there a better way, at least a few straightforward optimization (options) ?
gsc -exe -o scheme_matmul_classic.bin tmp.scmDetails are below.
Best regards,
Guillaume
1. Functional implementation:
https://github.com/glathoud/flatorize/blob/master/explore/scheme_matmul_list_of_lists.scm#L50
2. Ugly imperative implementation:
https://github.com/glathoud/flatorize/blob/master/explore/scheme_matmul_classic.scm#L33
3. Flat implementation (for the specific matrix sizes):
https://github.com/glathoud/flatorize/blob/master/explore/scheme_matmul342.scm#L31
To run both tests (interpreted and compiled), I used this:
https://github.com/glathoud/flatorize/blob/master/explore/scheme_matmul.sh#L16
Results:
https://github.com/glathoud/flatorize/blob/master/explore/scheme_matmul.results.txt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20130409/df28cd69/attachment.htm>
More information about the Gambit-list
mailing list