ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 23 Feb 2021 23:40:29 +0100Python kernel seriously slower than SageMath kernelhttps://ask.sagemath.org/question/55851/python-kernel-seriously-slower-than-sagemath-kernel/Hi, I just found the Python kernel is seriously slower than the SageMath one.
This was the snippet to reproduce:
# intersection profiling with Python session
from sage.all import *
def run(num):
cube = (polytopes.cube() * 37 / 45).change_ring(QQ)
for i in range(num):
hspace = Polyhedron(ieqs=[[1/2, 1/(i+1), 0, 0]]).change_ring(QQ)
intersection = hspace.intersection(cube)
%timeit run(100)
The timing for SageMath kernel is `1 loop, best of 5: 186 ms per loop`, while that for Python is `1 loop, best of 5: 7.07 s per loop`. With this snippet I think no variable was cached. I also cprofiled a stand-alone .py file with the same lines (expect the `%timeit` line), whose timing is close to the Python kernel. Any idea what could cause this huge performance difference?
[Image which kernel to use](https://ibb.co/DYg6f7F)zhaiyuTue, 23 Feb 2021 23:40:29 +0100https://ask.sagemath.org/question/55851/alternative to jupyter notebook?https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/ I have a number of problems using Jupyter notebook, windows 10.
When my .ipynb file reaches a certain length, sage basically grinds to a halt, and I need to start a new file. When doing a long calculation, where each bit needs the calculations from the previous part, this isn't practical. Also, when I "save" an .ipynb file, the actual calculations aren't saved, and each file takes about half a day to go through and recalculate everything again. I have about 5 files now, and the power keeps flickering on and off briefly...
Also, it happens constantly that sage won't let me type anything in. This can last for up to 10 minutes at a time, and seems to have something to do with the way the file is saved.
I haven't even reached the final part of my calculation, which is the part I expect to be the slowest by far.
My husband tells me to stop messing around with windows and learn Linux. Any other suggestions?
Thanks very much!IngridTue, 23 Feb 2021 06:11:34 +0100https://ask.sagemath.org/question/55818/Why is assume() so slow?https://ask.sagemath.org/question/37744/why-is-assume-so-slow/Declaring assumptions using `assume()` takes an awful lot of time, e.g.:
var('a b c d e f g h i')
assume([(var1, 'real') for var1 in [a, b, c, d, e, f, g, h, i]])
The same applies to declaring variables with the `domain` option, e.g. `var('a', domain='positive')`.
See also https://cocalc.com/projects/34b4b62a-2621-47c8-9bda-cde3a855f995/files/test_assumptions.ipynb for an example. Does anyone know why this takes so much time and/or how this could be made faster? Thanks a lot!stanTue, 30 May 2017 23:39:08 +0200https://ask.sagemath.org/question/37744/SAGE incredibly slow when running in Virtual Boxhttps://ask.sagemath.org/question/9587/sage-incredibly-slow-when-running-in-virtual-box/Hello I recently downloaded sage 5.4.1 and the latest version of VirtualBox.
Everything lags with 3d graphs and 3d vector plots taking up to 5 minutes to load.
On startup I noticed on boot grub complains about something with the VM but it does still start up.
I'm wondering how I can fix this problem? Sage is not really usable like this. SageQuestionerThu, 29 Nov 2012 13:37:03 +0100https://ask.sagemath.org/question/9587/gap calls seem to consume a lot of timehttps://ask.sagemath.org/question/8046/gap-calls-seem-to-consume-a-lot-of-time/
I am trying to migrate some code from GAP to sage, and the overhead for calls to GAP procedures is enormous. Here is an example:
----------------------------------------------------------------------
| Sage Version 4.6.2, Release Date: 2011-02-25 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: def test1():
....: for x in xrange(100): gap.eval('G:=Group([(1,2,3)])')
....:
sage: def test2():
....: gap.eval('for x in [1..100] do G:=Group([(1,2,3)]);od')
....:
sage: timeit('test1()')
5 loops, best of 3: 810 ms per loop
sage: timeit('test2()')
25 loops, best of 3: 12.6 ms per loop
Is there anything I am doing wrong?
I tried some profiling, which indicated that most of the time is consumed by "select.select".
Any help will be most welcome.parzanSat, 02 Apr 2011 13:30:45 +0200https://ask.sagemath.org/question/8046/