Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - fetchoo

#1
Hi



I tried the following and compared the running time with CCL



> (let ((s)) (time (dotimes (i 1000000) (set 's (cons (sqrt i) s)))))

... do not stop

> (let ((s)) (time (dotimes (i 1000000) (push (sqrt i) s))))

111.93 milliseconds



with CCL

? (let ((s)) (time (dotimes (i 100000) (push (sqrt i) s))))

848 milliseconds



in CCL (setq x (cons a x)) == (push a x), but it looks like it is not the case for newlisp (i tried set/setf/setq)



why is this? how set/setq/setf/cons are implemented?



Kind regards

Taoufik