On Oct 14, 2006, at 11:15 PM, Bill Hart wrote:

>> I decided to see just how much of an overhead there
>> is using NTL as opposed to something written
>> specifically *for* GMP.
>>
>> So over the weekend I wrote my own library (some of it
>> from code I already had lying around) of a selection
>> of functions similar to those in NTL's ZZ library
>> (which end up mimicing pretty much everything NTL does
>> in ZZ that GMP doesn't already do).
>> In comparing the times, I compared my code with NTL
>> compiled on top of GMP and tuned with Victor's script.
>> The result is that everything I implemented was
>> between 1.33 and 2.2 times faster than NTL (including
>> the stuff that doesn't rely on GMP at all - I just use
>> slightly better algorithms and save some time not
>> doing bounds checking in time critical functions).
>>
>> As I suspected, there is quite a lot of loss in
>> building one package on top of another that it wasn't
>> originally written to sit on top of, as NTL does.

Hi Bill,

A few comments.

I should say in advance I don't completely understand where you're  
coming from, but hopefully I can work that out over the next few  
emails :-)

(1)
I hope you're aware that currently SAGE's NTL wrapper is pretty  
hopeless. I mentioned this in one of my talks at Sage Days 2:

http://sage.math.washington.edu/home/dmharvey/padic-heights-talk.pdf

(specifically the slide titled "Problems with NTL interface")

These problems make NTL's functionality not very useful from a SAGE  
user's point of view, if they actually want to do any real  
calculations. I am planning to fix these problems, but first I need  
to do some work on SAGE's polynomial and polynomial ring classes, so  
it will take a little time.

(2)
I think it's wonderful that you're beating NTL. On the other hand,  
NTL is a big, mature library. To the extent that your code can  
actually replace the stuff in the NTL library, you might consider  
contributing your code to NTL itself. I've discussed a few  
improvements relating to polynomial multiplication with Victor Shoup,  
he seems quite receptive to new ideas and code, and there are plenty  
of examples in the code where he gives attribution to other people.  
He doesn't exactly have a blazingly fast release schedule, but in the  
long run that might be a good option.

(3)
The main stuff we're interested in (or at least, the main stuff I am  
interested in) from NTL is the following:
* ZZ_X
* ZZ_pX
* finite fields and polynomials over them
* Possibly zz_x, zz_pX

Do you think the kind of things you are doing to beat NTL are going  
to be able to beat its implementation of these things too?

I'm not that interested in the matrix classes. Also I'm not  
interested in wrapping NTL's ZZ class. (We do have a wrapper  
currently, but it's only there for completeness since we have a  
wrapper for ZZ_X, but really there's no need to have it.)

David


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to