This is very annoying... and should have been detected automatically.
Julian started [1] and it would be good to finish setting it up!
@Marc: could you perform some C profiling (it might work directly
inside Sage via %crun [2]).
[1] https://trac.sagemath.org/ticket/25262
[2]
http://doc.sagemath.org/html/en/thematic_tutorials/profiling.html#c-level-function-calls-crun
Le 23/11/2019 à 10:41, Marc Mezzarobba a écrit :
Something like object creation, memory allocation, basic arithmetic, or
cython calls seems to have become a lot slower recently.
Overall, my Python code using sage runs about 10% slower with 9.0.beta6
than with 8.9. The slowdown seems to be spread evenly across many
different functions.
But here is a simple example that shows a significant difference:
# 8.9
sage: def f():
....: a = 0
....: for i in xrange(10^7):
....: a += 1
sage: %time f()
CPU times: user 1.27 s, sys: 3 ms, total: 1.28 s
Wall time: 1.27 s
# 9.0.beta6
sage: def f():
....: a = 0
....: for i in range(10^7):
....: a += 1
sage: %time f()
CPU times: user 1.71 s, sys: 0 ns, total: 1.71 s
Wall time: 1.7 s
Note that a similar function running an empty loop is quite a bit
*faster* with 9.0.beta6 (as one may have expected with the Python
upgrade): ~260 ms vs ~300 ms.
Also,
sage: %time a = 3**(2**30+1)
and other computations using GMP with no back-and-forth with Python run
at the same speed with both versions, so GMP/MPIR versions or build
options are probably not to blame.
Any clue what is going on?
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sage-devel/b6775aea-511c-657d-768f-9f5f8c5df4c7%40gmail.com.