From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: Making 'eq' == 'eql' in bignum branch Date: Thu, 23 Aug 2018 10:13:38 +0200 Message-ID: <87efepqz4d.fsf@gmail.com> References: <29f933ac-a6bf-8742-66a7-0a9d6d3e5a88@disroot.org> <87lgaio7xd.fsf@tromey.com> <877em1cb0i.fsf@tromey.com> <765767b2-d2e5-a9a6-f724-d58ecf4847bb@cs.ucla.edu> <76081b5d-8c10-0a37-2c97-d4864c0faa80@cs.ucla.edu> <09153aed-361d-4f82-d9ac-b502314769ae@cs.ucla.edu> <83k1oldqao.fsf@gnu.org> <87r2irvk5f.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1535011948 9666 195.159.176.226 (23 Aug 2018 08:12:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 23 Aug 2018 08:12:28 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 23 10:12:24 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fskj8-0002Jz-PW for ged-emacs-devel@m.gmane.org; Thu, 23 Aug 2018 10:12:22 +0200 Original-Received: from localhost ([::1]:35121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsklF-0000jz-4L for ged-emacs-devel@m.gmane.org; Thu, 23 Aug 2018 04:14:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fskkW-0000ju-Ly for emacs-devel@gnu.org; Thu, 23 Aug 2018 04:13:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fskkR-0000sO-My for emacs-devel@gnu.org; Thu, 23 Aug 2018 04:13:48 -0400 Original-Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:51728) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fskkR-0000rg-Du for emacs-devel@gnu.org; Thu, 23 Aug 2018 04:13:43 -0400 Original-Received: by mail-wm0-x236.google.com with SMTP id y2-v6so4335231wma.1 for ; Thu, 23 Aug 2018 01:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-followup-to:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=fL8rx1UbI/PdNH9h1OTnvz++hnvXoqouG13jywZk/ts=; b=CWkgQHcVWtdfzRKd9aps2jIx9IJKJtpU4MA3X2MDAt+iT3quYlZ7efWfhrGPlWpS/D xd1DLS2E0K6/k8w/gI6FFAa9pfMSYF35uwQhX8PTSF8n3fzydaqs28epVJ9dhJ4Is3ae KohKtiBoLv9K1hhg+eD0LcecCSlW9hsbi8wc6+k42On0k6w3vLxdSkJ/PFqV+jxXxR3i XZHZAVveXDfctY7n122Fm3ru2YDxNQJimInsnPRxMwmoA6630o6/dAK4RM7ah6vv8VBB MuuFk2OjBA1qYxRXOB0EKmpOz+5VVUOXDVko1s0dDCygFxkozChq1BrfBb4PIGayoT5+ mx+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-followup-to :mail-copies-to:gmane-reply-to-list:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=fL8rx1UbI/PdNH9h1OTnvz++hnvXoqouG13jywZk/ts=; b=KzFkG1EgdigLzKlRalKjDdNnIYffCADpRWDJNUycx3kKD+VfxTctriZZuuHdh6tl1Z i5ub4VLHhnJ0pHiY8Zu7kZh777ZAi4TDj+sduv9i61HeDyddIPcApYmQN6JVfqUa8sSq 6SokPDqJHOb1VO60de9wJtQobmIF6ucN6fT6+vkXYFx8oSuN8XNccD/8kj9kSiuzOCH3 fSUXh8x94Anl8LmSDsno7+HGq/E2Z5UVSQLY3zju3iX0U/qNihI9nEgGN3QJnrpOt2ht AC7ktbfGSMBSuhoyOE98hnuc9fgBipcKMLcwu8trBwtSpW9No15FPnxus/Tx/Qn2AEPV XAXQ== X-Gm-Message-State: APzg51AtRfD9/PE2WaABBwR5YGQ1k9nOakJ1kweArppdbwFwHW8HLmkc 23Uy383P7t/pO+weJWNgZaIvJq8Z X-Google-Smtp-Source: ANB0VdZKYlB4MX4oAogbC+KBDxjGpBi//L46m6S4CC3jg//C/X3Fkhvvq8aCaR1gTRXjkQv1+GM/hQ== X-Received: by 2002:a1c:b756:: with SMTP id h83-v6mr4773249wmf.8.1535012021900; Thu, 23 Aug 2018 01:13:41 -0700 (PDT) Original-Received: from rpluim-ubuntu ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id p11-v6sm1275306wrd.74.2018.08.23.01.13.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Aug 2018 01:13:39 -0700 (PDT) Mail-Followup-To: emacs-devel@gnu.org Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: (Stefan Monnier's message of "Wed, 22 Aug 2018 16:01:08 -0400") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::236 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:228842 Archived-At: Stefan Monnier 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 big= nums? >> 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=CA=BCt know about that. Would there be any issue with merging such changes back to emacs? I assume it=CA=BCs 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 234287928374298347289374298347234782937428934723489729= 374823 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.