While testing my memory usage report patch, I found that loop in SBCL
is much slower than other Lisps and takes much more (20x) RAM!
[x for x in 1..5*10^5];
For SBCL, it takes 1.75s and 668MB;
For ECL, it takes 0.34s and 36MB;
For CCL, it takes 0.11s and 20MB;
For CLISP,it takes 4.87s and 340MB.
Not only that,
")lisp (progn (loop for x from 1 to 5000000 collect x) 1)"
is also slow in FriCAS, but fast in SBCL.
After some debugging, I found that
(setf sb-ext:*evaluator-mode* :interpret)
in src/lisp/fricas-lisp.lisp is responsible.
Quoting Waldek from "Re: sbcl: 971 Segmentation Fault" in 2007:
````
You may delete this line -- this line just tries to optimize build
speed. Namely, Axiom during Spad compilation makes heavy use of eval.
Profiling indicated that more than 10% of time is spent compiling
Lisp forms passed to eval. The line above switches sbcl
evaluator to use true interpretation, which significantly
reduced time used by eval. However, sbcl got interpreted evaluation
somwhere late within 0.9 series.
````
So it was an optimization for building. I did following test (make -j8):
Build FriCAS by default : 3m26.863s, test (-j1) takes 1m1.040s
Build FriCAS without :interpret: 3m23.284s, test (-j1) takes 1m14.889s
Build FriCAS with sb-fasteval: 3m19.433s, test (-j1) takes 1m1.311s
So nowadays this option does not affect build time at all. (It does
affect test running a bit though. Not look into it yet.)
After removing this setting, the loop is fast now: 0.11s and 21MB.
So shall we do this change?
- Qian
--
You received this message because you are subscribed to the Google Groups "FriCAS -
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/7b034872-94c4-4c7e-9ab9-758a086ffa15%40gmail.com.