Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Jupyter seriously slower than SageNB

Hi, I just found the Jupyter session is seriously slower than the SageNB 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 in SageNB is 1 loop, best of 5: 186 ms per loop, while that in Jupyter 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 Jupyter one. Any idea what could cause this huge performance difference?

Jupyter seriously slower than SageNB

Hi, I just found the Jupyter session is seriously slower than the SageNB 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 in SageNB is 1 loop, best of 5: 186 ms per loop, while that in Jupyter 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 Jupyter one. Any idea what could cause this huge performance difference?

Jupyter Python kernel seriously slower than SageNBSageMath kernel

Hi, I just found the Jupyter session Python kernel is seriously slower than the SageNB 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 in SageNB for SageMath kernel is 1 loop, best of 5: 186 ms per loop, while that in Jupyter 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 Jupyter one. Python kernel. Any idea what could cause this huge performance difference?

Image which kernel to use

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 useImage which kernel to use