On Thu, Mar 12, 2015 at 6:54 AM, Shivam Vats <[email protected]> wrote:
> Hi Fredrik
>
> Indeed! Packin/unpacking when repeated 1000 times, takes too much time. And
> anyway,
> we don't need to pack and unpack every time.
>
> ```
>          res = 2*x+1
>     ...: for i in range(1000):
>     ...:     res = R.dup_mul(2*x+1, res)
>
>        : t1 = clock()
>     ...: res2 = R.dup_mul(res, res)
>     ...: t2 = clock()
>     ...: print(t2-t1)
>     ...:
> 1.30838489532
>
>        : t1 = clock()
>     ...: res2 = R.dup_pack_mul(res, res)
>     ...: t2 = clock()
>     ...: print(t2-t1)
>     ...:
> 0.579982995987
> ```
> This should be a better comparison between the two methods. So, Kronecker
> does outperform
> Karatsuba.
>
> Thanks a lot for pointing out!

Thanks for coding this up!

My experiments with Piranha show that packing the exponents speed
things up about 7x. It might be that packing is much faster in C++
than in Python.

Ondrej

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CADDwiVBQHXEzOq77Qy-WEw11PyHJihLT%3DVhL8qeBcn%2Bog%2Bh%2Bew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to