powerseries creation takes long time.

37 views
Skip to first unread message

Hao Chen

unread,
Apr 25, 2016, 7:18:09 PM4/25/16
to sage-devel
I was trying to define a power series 1 + O(x^(5e6)) with base ring the finite field with 13 elements. 
And it is taking surprisingly long. 

sage: F = GF(13); R.<x> = F[[]]
sage: prec = 5*10^6
sage: timeit('R([1], prec)') # long time.
5 loops, best of 3: 1.04 s per loop

Could someone kindly point out if I messed up somewhere? Thanks! -- hao

Travis Scrimshaw

unread,
Apr 25, 2016, 10:46:29 PM4/25/16
to sage-devel
Hey Hao,
   I cannot reproduce on 7.2.beta5:

sage: F = GF(13); R.<x> = F[[]]
sage
: prec = 5*10^6

sage
: %time R([1], prec)
CPU times
: user 1.62 ms, sys: 326 µs, total: 1.95 ms
Wall time: 1.87 ms
1 + O(x^5000000)

Best,
Travis

Hao Chen

unread,
Apr 25, 2016, 11:20:02 PM4/25/16
to sage-devel
Dear Travis, 

Indeed I was using Sage 6.8. I switched to 7.2 and it is okay. Thank you for pointing this out! -- Hao
Reply all
Reply to author
Forward
0 new messages