emacs-devel
[Top][All Lists]
Advanced

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

Re: Making 'eq' == 'eql' in bignum branch


From: Robert Pluim
Subject: Re: Making 'eq' == 'eql' in bignum branch
Date: Thu, 23 Aug 2018 10:13:38 +0200

Stefan Monnier <address@hidden> writes:

>>>> I don't think we should go as far as removing these functions, as they
>>>> can still be useful in some situations.  Let's not rush.
>>> Agreed.  How 'bout we first try to actually make use of bignums?
>>> E.g. changing Calc to use them instead of its own implementation of bignums?
>> That probably wouldn't be too hard.
>
> IIUC, such changes have already been applied to the Calc that's
> distributed with SXEmacs (where Calc's former maintainer moved), so it's
> probably worth looking at that code (and associated doc).

I didnʼt know about that. Would there be any issue with merging such
changes back to emacs? I assume itʼs all GPL, but there might be
copyright assignment issues.

>> Any suggestions for what kind of tests you'd want of the result?
>
> Fast and exhaustive tests, of course ;-)

It passes the test-suite, which has 5 tests :-)

In terms of speed:

(require 'calc-units)
(dotimes (i 10)
  (benchmark 1
    '(dotimes (i 10000)
       (calcFunc-mul 230584300921369395100000000
                     10000000000000000000000000000000000000000
                     
234287928374298347289374298347234782937428934723489729374823
                     7492837429837))))

master:

Elapsed time: 0.687519s (0.114858s in 15 GCs)
Elapsed time: 0.683179s (0.122283s in 14 GCs)
Elapsed time: 0.688424s (0.125096s in 15 GCs)
Elapsed time: 0.683192s (0.117345s in 14 GCs)
Elapsed time: 0.691941s (0.127961s in 15 GCs)
Elapsed time: 0.692849s (0.126826s in 15 GCs)
Elapsed time: 0.679750s (0.116932s in 14 GCs)
Elapsed time: 0.682929s (0.122974s in 15 GCs)
Elapsed time: 0.689449s (0.125723s in 15 GCs)
Elapsed time: 0.707762s (0.114604s in 14 GCs)

master using native bignums:

Elapsed time: 0.074445s (0.028334s in 4 GCs)
Elapsed time: 0.057261s (0.022541s in 3 GCs)
Elapsed time: 0.063773s (0.030844s in 4 GCs)
Elapsed time: 0.056425s (0.023070s in 3 GCs)
Elapsed time: 0.065788s (0.031533s in 4 GCs)
Elapsed time: 0.065265s (0.031403s in 4 GCs)
Elapsed time: 0.056984s (0.022835s in 3 GCs)
Elapsed time: 0.064079s (0.030197s in 4 GCs)
Elapsed time: 0.057158s (0.023442s in 3 GCs)
Elapsed time: 0.071579s (0.035323s in 4 GCs)

so using native bignums appears to be ~10x faster that calc's bignums,
and create less garbage.



reply via email to

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