питон:
den@ira-desktop:~/work/test$ time python -O test.py
('answer: ', 39)
real 0m33.035s
user 0m32.890s
sys 0m0.084s
den@ira-desktop:~/work/test$
clisp:
den@ira-desktop:~/work/test$ time clisp test.lsp
39
real 2m44.491s
user 2m42.970s
sys 0m1.464s
den@ira-desktop:~/work/test$
def test():
r = 0
for i in range(0, 10000):
for j in range(0, 10000):
r = (r + (i * j) % 100) % 47
return r
r = test()
print("answer: ", r)
(defun test ()
(setq r 0)
(dotimes (i 10000 r)
(dotimes (j 10000 r)
(setq r (mod (+ r (mod (* i j) 100)) 47))
)
)
)
(write (test))
а теперь докажите, что лисп не тормознутое УГ