guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile uses GNU MP


From: Jim Blandy
Subject: Re: Guile uses GNU MP
Date: 03 Oct 2000 10:10:08 -0500

Marius Vollmer <address@hidden> writes:

> Jim Blandy <address@hidden> writes:
> 
> > > Technically, I despise a huge amount of #ifdefs.  Would it be possible
> > > to implement the support for both GNU MP and what we have now by
> > > having two separate files, say numbers-gmp.c and numbers-scm.c?
> > 
> > Well, all the arithmetic operators are generic functions.  Doesn't
> > goops make this problem pretty easy to solve?
> 
> Yees, but I'm worried about performance.  GOOPS is fast, but somehow I
> don't think we should a full blown dispatch whenever two fixnums are
> added, for example.
> 
> Currently, the arithmetic functions are a special kind of generic
> function.  You can add methods to them, but you can't change the
> methods that specialize on the builtin numeric types.  In fact the
> dispatch to the methods for builtin types are hardcoded into a big
> chain of ifs, or something.

I think performance for fixnums and perhaps flonums is critical; for
them, it's worth hard-coding the logic.  But for bignums, think about
the code you're about to invoke... the dispatch overhead is probably
not too significant.  The allocation overhead (including GC time) is
probably several times greater.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]