On Thursday 27 October 2011, Simon King wrote:
> Hi!
> 
> I just found the following:
>   sage: P.<x,y,z> = QQ[]
>   sage: def test1(x,y,z):
>   ....:     for i in range(100):
>   ....:         p = (x+y+z)^i
>   ....:
>   sage: def test2(x,y,z):
>   ....:     x = singular(x)
>   ....:     y = singular(y)
>   ....:     z = singular(z)
>   ....:     for i in range(100):
>   ....:         p = (x+y+z)^i
>   ....:
>   sage: %time test1(x,y,z)
>   CPU times: user 2.66 s, sys: 0.00 s, total: 2.66 s
>   Wall time: 2.67 s
>   sage: %time test2(x,y,z)
>   CPU times: user 0.15 s, sys: 0.08 s, total: 0.23 s
>   Wall time: 1.94 s
> 
> The timings were obtained with sage-4.6.2.
> 
> So, replacing libSingular with Singular-via-pexpect saves much of the
> computation time.
> 
> Is that something to worry about?

Yes! 

I can confirm this behaviour. The problem doesn't seem to be restricted to 
__pow__, i.e. replacing ^i by products also gives slower results when using 
using libSingular. However, mod p it seems libSingular wins. Hence my guess: 
we are using different memory allocation functions for GMP and these functions 
might be slower (for Singular's use case)?

Cheers,
Martin

--
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://martinralbrecht.wordpress.com/
_jab: martinralbre...@jabber.ccc.de

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to