People,
can you, please, answer the following beginner questions on compilation
and performance
(for FriCAS-1.1.5 - GNU CLISP 2.48 - Debian Linux).
Consider the following program that counts by decreasing n by a string
length.
-- file ct.input -------------------------------------
all x == true
ct(n : Integer) : Integer ==
str := "abc"
i := n
while i > 0 repeat i := i - count(x +-> true, str)
return i
--------------------------------------------------------
Is count(x +-> true, str) the simplest way to find a string length?
Is ct written in the Spad language?
After )r ct
all 1
ct 9,
the FriCAS dialogue says that `all' and ct have been compiled.
Is this the same code for `all' and ct that is produced from the
.spad file? If not, then has it at least the same performance?
Replacing `x +-> true' with `all' reduces the performance about 10
times
(apply ct (4*10^5) for a 1 GHz machine).
Why is it so unstable?
Does this particular performance example depend on the Lisp version?
How to write a reliably fast program?
Regards,
------
Sergei
[email protected]
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en.