[Vm-dev] Re: [squeak-dev] New Cog VMs available

Eliot Miranda eliot.miranda at gmail.com
Wed Jul 13 17:06:41 UTC 2016

Hi Luciano,

On Wed, Jul 13, 2016 at 9:59 AM, Luciano Notarfrancesco <luchiano at gmail.com>

> Hi Eliot,
> My only point is performance. GMP is highly optimized, it includes
> optimizations made by hand for each particular processor, so for example
> the multiplication of large enough integers should be much faster than our
> implementation in Slang. And it seems that we wouldn't need to change
> anything in the image or do any conversions or marshaling, just call the
> mpn_* low-level functions from the large integers plugin. But if we have to
> marshal everything it doesn't make much sense to use GMP, because it will
> be slower for relatively small large integers.
> I'm working on computer algebra in Smalltalk and I'd like to be
> competitive with other computer algebra systems (GAP, Magma, etc), and in
> many cases the bottleneck is large integer arithmetic.
> So I'm very happy about the recent speed up using 32 bits legs and
> avoiding function calls for type checking. That will have an impact in my
> benchmarks. Thanks!

Well, I won't stand in the way of you gaining more performance; quite the
opposite; I encourage it.  If you have energy here please apply it.  But it
would be nice if you added the speedups to our code base rather than
introduced a dependency on GMP.

I was going to suggest working with Sista, but that leaves the interpreter
VMs out in the cold.

> On Wed, Jul 13, 2016 at 12:52 PM, Eliot Miranda <eliot.miranda at gmail.com>
> wrote:
>> 1. the existing code is functional and adequate.  GMP offers no new
>> functionality and may offer performance improvements or may not.  But the
>> existing code is capable of being tuned also.
>> 2. The existing plugin is internal; with the "new" linkage I wrote two
>> years ago now internal plugins have a much simpler call interface into the
>> VM (no double calls through a pointer anymore; just direct calls on the VM
>> functions). But LGPL forces us to make the plugin external.  Hence using
>> GMP implies a loss of performance in marshaling arguments and allocating
>> and returning results.
>> IMO these two together make GMP irrelevant.  Less compelling reasons are
>> 3. Yet another library to install on all build environments; AFAIA it's
>> not present on non-Linux platforms
>> 4. Being a library we don't control we're dependent on others fixing it.
>> What reasons, other than brand identity are there for using GMP?
>> Could we use it if was already installed in the host platform? It seems
>> to me that it would be quite straight forward to call to the GMP low-level
>> API from the LargeIntegersPlugin, without making any changes in the image.
>> https://gmplib.org/manual/Low_002dlevel-Functions.html

best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160713/8c10b131/attachment-0001.htm

More information about the Vm-dev mailing list