[sage-devel] Faster coercions!

2018-12-01 Thread Jeroen Demeyer
This week I worked on the coercion model to make it faster. It turns out that there was some margin for micro-optimizations. There are two tickets in need of review: #26776 and #26790. If you need to be convinced, run sage: a = RR(25); b = ZZ(2) sage: timeit('a+b', repeat=100, number=10) *

[sage-devel] Memory leak in poset dimension()

2018-12-01 Thread Jori Mäntysalo
This shows a leak: i = 0 for P in Posets(8): if i % 1000 == 0: gc.collect() print get_memory_usage() i += 1 _ = P.dimension() To compare, width() and height() does not seem to leak. -- Jori Mäntysalo

Re: [sage-devel] Re: Other memory leaks

2018-12-01 Thread Jori Mäntysalo
On Sat, 1 Dec 2018, 'Martin R' via sage-devel wrote: I confirm that the following leaks: I created https://trac.sagemath.org/ticket/26795 for this and similar. -- Jori Mäntysalo

[sage-devel] Re: Other memory leaks

2018-12-01 Thread 'Martin R' via sage-devel
I confirm that the following leaks: def bad8(n): """ sage: bad8(10) """ from sage.graphs.independent_sets import IndependentSets G = Graph(2) for i in range(n): x = [0] in IndependentSets(G) if i % 1 == 0: print get_memory_usage() -- Yo

[sage-devel] Other memory leaks

2018-12-01 Thread Jori Mäntysalo
For example PS_all_new_cells in src/sage/groups/perm_gps/partn_ref/data_structures.pyx contains bitset_init(scratch, n) but there is no bitset_free(scratch) anywhere. Does that mean that the function leaks memory? Then, in src/sage/graphs/independent_sets.pyx the class IndependentSets seems t

Re: [sage-devel] the command: "E = EllipticCurve('14a1') K. = E.division_field(5); K" never finishes

2018-12-01 Thread John Cremona
On Sat, 1 Dec 2018 at 08:42, Steven Craighead wrote: > E = EllipticCurve('14a1') > K. = E.division_field(p); K for p = 2 and 3 finishes quickly. When I > use p = 5 or p = 7, the command never finishes. > The docstring warns (do E.division_field? to see it) that "This takes a very long time when

Re: [sage-devel] memory problem

2018-12-01 Thread 'Martin R' via sage-devel
needs review. -- 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 post to this group, send email to sage-devel@googlegroups

[sage-devel] the command: "E = EllipticCurve('14a1') K. = E.division_field(5); K" never finishes

2018-12-01 Thread Steven Craighead
E = EllipticCurve('14a1') K. = E.division_field(p); K for p = 2 and 3 finishes quickly. When I use p = 5 or p = 7, the command never finishes. I use Sagemath 8.4 on a linux mint 19. This is a toshiba AMD Turion II Dual Core Process M500 with 4GB ram. This is a Pentium 64-bit. -- You receiv

Re: [sage-devel] memory problem

2018-12-01 Thread Jori Mäntysalo
On Sat, 1 Dec 2018, 'Martin R' via sage-devel wrote: https://trac.sagemath.org/ticket/26794 I don't think that this is critical. The user never gets wrong answers because of this. Anyways, needs to be corrected. This is cython thing, not python. I'm not familiar with cython, so maybe someo

Re: [sage-devel] memory problem

2018-12-01 Thread 'Martin R' via sage-devel
https://trac.sagemath.org/ticket/26794 Am Samstag, 1. Dezember 2018 08:57:36 UTC+1 schrieb Martin R: > > OK, here is code that certainly leaks and confirms what you found, Jori. > Congratulations! > > def check_bad5(n): > """