Re: Fwd: Cryptokit port to Numerix
On Tue, Dec 16, 2003 at 07:23:18PM -0800, Michael K. Edwards wrote:
> On Tuesday 16 December 2003 03:29 pm, Sven Luther wrote:
> > On Tue, Dec 16, 2003 at 02:42:33PM -0800, Michael K. Edwards wrote:
> > > On Tuesday 16 December 2003 01:09 am, Sven Luther wrote:
> > > The port to Numerix was easy enough, and gained 10-30% performance on RSA
> > > operations on my test system; may be better on memory management scores
> > > as
> > Well, Xavier claims a 50% speed improvement of the new bignum library
> > over the old one for athlon 64, pentium 4 and powerpc.
> I'll be interested in seeing the numbers for cryptokit RSA ops with the new
> bignum; I think most of the speed gain in the Numerix port had to do with the
> Numerix powmod operation mentioned below. I didn't do anything special for
> speed's sake otherwise, although I was systematic about minimizing the number
> of temp variables needed.
Well, i had a look at the new bignum (i upload a tarball of the
standalone version to people.debian.org/ocaml, together with the old
non-free version), and you can have a look.
The fact that it works faster on powerpc and pentium4/Athlon64 is
probably due to the fact that it makes use of SSE2 on the x86 arches,
and maybe altivec on powerpc, not sure.
> > > I am open to other tools as well; I am new to OCaml and guessed that
> > > findlib was the most common way of setting up shared libraries, etc.
> > > Please correct me if that's incorrect.
> > Well, i personnally prefer the good old manual way, but others disagree.
> Could you point me to a package that does it the manual way, and a program
> that uses the library installed by that package? I want to make sure I'm
> putting all the pieces in the right place.
Well, the main difference as i see it, is the way .cm* are listed in the
command line. With findlib you just tell it to sort this out, and if the
libraries did provide META files, it will search for these stuff alone.
On the other hand, with the manual way, you know what libraries are
needed and where they are. So in the Makefile, you provide the files in
the right linking order, and add the proper -I +foo to the compiler
flags. foo being in general the name of the library, and the + means
that it is found in subdirectory foo of `ocamlc -where`.
But again, i am not a findlib fan, so other may speak better about it.
All library packages must provide a META file though, which should go
into `ocamlc -where`/METAS (or whatever the final chosen name was,
Stefano can you confirm this ?).
> > > IMO it should wind up in libcryptokit-ocaml and libcryptokit-ocaml-dev.
> > > The upstream build doesn't seem to make shared libraries (which will be
> > > needed for libcryptokit-ocaml AIUI), so I will need to do some rework.
> > > (I'm working
> > Well, the shared libraries are only really needed if there is a dll.so,
> > built from C stubs. I don't remember well if this is the case for
> > cryptokit or if it is a native ocaml library.
> cryptokit does have C portions and builds a dll.so (as a side effect of
> running ocamlmklib). As mentioned above, I'm not quite sure what to do with
> it, since cryptokit's "make install" target doesn't do anything with it.
You have to move it to `ocamlc -where`/stublibs.
> > > on the Numerix packages now, which will include libnumerix and
> > > libnumerix-dev (C interface) as well as libnumerix-ocaml and
> > > libnumerix-ocaml-dev.
> > Ok, cool.
> These packages are getting close; I will have candidates as soon as the dll.so
> is added.
Ok, i will prepare new bignum packages today too.
BTW, i will also make new ocaml packages, that install the config/Makefile
and provide make variables for the new cryptokit. I should also include
a new version of the ocaml_packaging_manual there, what is the current
status of that ?