On Friday 28 October 2011, William Stein wrote:
> On Thu, Oct 27, 2011 at 12:57 PM, Volker Braun <vbraun.n...@gmail.com> 
wrote:
> > On Thursday, October 27, 2011 1:38:34 PM UTC-4, Martin Albrecht wrote:
> >> Sure, but it's still worrisome that a computation is slower in
> >> libSingular than in Singular.
> > 
> > Just to reiterate in case I wasn't clear, as long as the "computation in
> > Singular" just references a singular variable as output and "libsingular"
> > converts the output to Sage datastructures the latter is always going to
> > be slower.
> 
> That is not what is happening here.  libsingular is definitely not
> converting the output to Sage datastructures.  The Sage polynomials
> x,y,z are simply Cython level wrappers around a pure Singular
> datastructure.
> 
> sage: type(x)
> <type
> 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingula
> r'>
> 
> I'm pretty surprised by this benchmark.
> 
> The timing difference on my computer is even more:
> 
> sage: time test1(x,y,z)
> Time: CPU 4.89 s, Wall: 4.89 s
> sage: time test2(x,y,z)
> Time: CPU 0.15 s, Wall: 1.73 s
> 
> It really comes down to this (following exactly the code that Simon
> posted):
> 
> sage: time v = (x+y+z)^100
> Time: CPU 0.23 s, Wall: 0.23 s
> sage: xx=singular(x);yy=singular(y);zz=singular(z)
> sage: time v = (xx+yy+zz)^100
> Time: CPU 0.00 s, Wall: 0.06 s
> 
> Why is exponentiation dramatically faster in case 2 than 1?   Note
> that the *wall time* is what matters in both cases, by the way.

I think we should compare which function the Singular interpreter calls and 
which we call and also see if we get the same performance if we switch to 
OMalloc (I'm not suggesting to switch to OMalloc, just for testing)

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