[ prog / sol / mona ]

prog


The Main Difference Between Symta and Python

1 2024-08-14 17:04

https://lj.rossia.org/users/nancygold/192317.html

<code>$ time ./symta.exe -e 'I 0; while I < 100000000: ++I; say I'
100000000
No
real 0m 1.40s
user 0m 0.14s
sys 0m 0.00s

$ time python -c "i = 0; [i := i+1 for _ in range(100000000)]; print(i)"
100000000
real 0m 6.31s
user 0m 1.25s
sys 0m 0.71s

$ time ./symta.exe -e 'I 0; while I < 1000000000: ++I; say I'
1000000000
No
real 0m 13.74s
user 0m 9.20s
sys 0m 0.01s

$ time python -c "i = 0; [i := i+1 for _ in range(1000000000)]; print(i)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "<string>", line 1, in <listcomp>
MemoryError
Command exited with non-zero status 1
real 0m 10.72s
user 0m 4.00s
sys 0m 1.43s</code>

5


VIP:

do not edit these