Re: [sage-support] much memory is used...

2018-10-09 Thread Jeroen Demeyer
On 2018-10-09 12:00, Dima Pasechnik wrote: Well, primitive, as opposed to added by Sage. E.g. I suppose one cannot use it for RDF. If you really want to get elements of RDF, you could use a Sage vector instead. -- You received this message because you are subscribed to the Google Groups

Re: [sage-support] much memory is used...

2018-10-09 Thread Dima Pasechnik
On Tue, Oct 9, 2018 at 10:45 AM Jeroen Demeyer wrote: > > On 2018-10-08 14:28, Dima Pasechnik wrote: > > Can you use array.array on anything that's not a primitive Python type? > > I don't know what you mean with "primitive Python type". Anyway, it > supports various kinds of basic C types (like

Re: [sage-support] much memory is used...

2018-10-09 Thread Jeroen Demeyer
On 2018-10-08 14:28, Dima Pasechnik wrote: Can you use array.array on anything that's not a primitive Python type? I don't know what you mean with "primitive Python type". Anyway, it supports various kinds of basic C types (like double for example). Docs here:

Re: [sage-support] much memory is used...

2018-10-08 Thread Dima Pasechnik
On Mon, Oct 8, 2018 at 1:07 PM Jeroen Demeyer wrote: > > On 2018-10-08 13:19, Thierry Dumont wrote: > > So my list should use less than 1gb, if it phi was a C array. > > But it's not a C array. There is overhead for Python garbage collection, > the Sage parent, the Cython virtual method table...

Re: [sage-support] much memory is used...

2018-10-08 Thread Jeroen Demeyer
On 2018-10-08 13:19, Thierry Dumont wrote: So my list should use less than 1gb, if it phi was a C array. But it's not a C array. There is overhead for Python garbage collection, the Sage parent, the Cython virtual method table... If you really want a C array, use array.array or numpy. --

Re: [sage-support] much memory is used...

2018-10-08 Thread Thierry Dumont
Le 08/10/2018 à 12:56, Dima Pasechnik a écrit : > On Mon, Oct 8, 2018 at 11:34 AM Thierry Dumont > wrote: >> >> I do: >> >> N= 10^8 >> theta= RDF(2*pi/N) >> phi=[i*theta for i in range(0,N)] >> >> not something sophisticated...! >> >> Also: it is not a good idea do do that: better use numpy. BUT

Re: [sage-support] much memory is used...

2018-10-08 Thread Dima Pasechnik
On Mon, Oct 8, 2018 at 11:34 AM Thierry Dumont wrote: > > I do: > > N= 10^8 > theta= RDF(2*pi/N) > phi=[i*theta for i in range(0,N)] > > not something sophisticated...! > > Also: it is not a good idea do do that: better use numpy. BUT > > looking at "top" during the computation of > phi=[i*theta

[sage-support] much memory is used...

2018-10-08 Thread Thierry Dumont
I do: N= 10^8 theta= RDF(2*pi/N) phi=[i*theta for i in range(0,N)] not something sophisticated...! Also: it is not a good idea do do that: better use numpy. BUT looking at "top" during the computation of phi=[i*theta for i in range(0,N)], the memory used jumps to 3Gb and then grows, grows...