> 
> I tested with "a := new(2*10^7,2)$List INT;", and before
> each call, I do a ")lisp (SB-EXT:GC)" to avoid GC during
> benchmarking.
> 
> MAKELIST takes 0.29~0.33s, the loop takes 0.34~0.39s.

IMO it is not worth calling Lisp functions for rather small
gain.

BTW: 'new' for lists exists mainly because of generic
interface.  However normally after 'new' aggregate
is modified.  In case of lists in almost all cases it
will be more efficient to create list in incremental way
using desired values instead of modification.

BTW2: If you are worried that [...] is slower than
MAKELIST you should rather work on increasing speed
of list comprehesion (that is [....]).  Current
version constructs list in reverse order and then
destructively reverses the result.  It means that
list have to be traversed two times.  For short
list second traversal is very fast because
list is in cache.  But for long lists we pay
cost of reading it from RAM (you have 32 MB of
data which almost surely is bigger than largest
cache in your machine).

-- 
                              Waldek Hebisch

-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to