From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: Question about bignum usage Date: Thu, 20 Jun 2024 15:07:12 +0200 Message-ID: References: <86frt8nn8b.fsf@gnu.org> <86ed8snk0p.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36052"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org, Helmut Eller To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 20 15:07:59 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sKHWB-0009Fa-DW for ged-emacs-devel@m.gmane-mx.org; Thu, 20 Jun 2024 15:07:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKHVY-0006My-71; Thu, 20 Jun 2024 09:07:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKHVW-0006Mo-J3 for emacs-devel@gnu.org; Thu, 20 Jun 2024 09:07:18 -0400 Original-Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sKHVU-0007Ag-Tj; Thu, 20 Jun 2024 09:07:18 -0400 Original-Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-57d06101d76so845839a12.3; Thu, 20 Jun 2024 06:07:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718888834; x=1719493634; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=jO/6o/GAIhecGe5iIQLSU7eyVcVqLxFQ2WhdAKK9N50=; b=UQb2l1KgvfLhsdZAVVWRFmw9G1f9czc/pWrPgunRckNaRo+IGAJtvNaHK2hdC3oaxE 0R3d0KtL3sKM6c3jPzE0WmHWB6W3G3udt+Fv55ik8prkrc2w/vkZm6IftPFkA+mLEJdY jXmoIzi7rkNIJaENQmiE8y1yUSf5b/1OreIEMVHRAVFIRVaMivONka1WV0AtXpdsxIDT MH7nCzr+3jFbQxfH6ZG1w1bjPdviy/rfDc9H7AIw4/hq/T/w1xaKKGsSnUyFZOnWtkwu H/FrCIz+gK6QUVWEkCY9XC0y7ahX9ETkJBU/1+ot8kIwlxUw58hwDyHq2lD96lBNiOR7 RY9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718888834; x=1719493634; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jO/6o/GAIhecGe5iIQLSU7eyVcVqLxFQ2WhdAKK9N50=; b=jPzGQ3RupYzm0cWqi2Lco36M0SUE2z5Fab1V9CBjN7JUiO8LnwQrAVheMVlb+h/Tib FGfec6ctyr+sJUcMfXfYVjwfSaJ6X1DA0CMJ2icMyjeHasVIQgT+C7/duukdAQRuF2XH dEOM4Ag/YpB8ZGXsoEdjdETfAzNcIbJEBInIygGrwLw9uNR4aQ5rISR1lHz9qEcC2wPy fKY5HEr/PM9b6x9O6bdyNq1mWVtKmWa6I2niVL6hoiSUmgpvzryMi5PTbW0xe7d3OxM1 P6uHV5i1EHMQhrpr7AzLkjM37iu9uelwds2jMbC2GhdRR+4jvtne8u3DZQC+RXap0ASH 7VoA== X-Gm-Message-State: AOJu0YwdrQLMxlkT19MeOlTx3mqBzG4VrzOlhhKHyzpJosfpEUBS58nf bS1xbB7uASAYbfbuNfvcSJRlpGB9zgczrlSpOudJuZrYx8s9mYTa X-Google-Smtp-Source: AGHT+IELGeW5pxAb5+9ov7wOEqtBgF9fAY3EIADelBad5z24oT7KeMseM3SSGntzcE7cxGdmkOEtgg== X-Received: by 2002:a50:931a:0:b0:57c:5f58:58c8 with SMTP id 4fb4d7f45d1cf-57d07edded2mr2611521a12.40.1718888833807; Thu, 20 Jun 2024 06:07:13 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a551.dip0.t-ipconnect.de. [79.227.165.81]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57cb72da790sm9643942a12.35.2024.06.20.06.07.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 06:07:13 -0700 (PDT) In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Thu, 20 Jun 2024 10:35:14 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:320319 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Gerd M=C3=B6llmann writes: > the second is bytes. The number of fonts is also curious. > > PVEC_FONT 90422 10868392 > > But all seem to be GC'd eventually. FWIW, I'm attaching the Lisp that I currently use to display this stuff. Something hacked together. M-x igc-stats displays a buffer in which one can take two snapshots of igc-info, display them, sompare them, trigger GC and so on. The PVEC_FONT stuff is impressive :-)=20 --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=igc-stats.el Content-Transfer-Encoding: quoted-printable Content-Description: igc-stats.el ;; -*- lexical-binding: t -*- (defun igc-stats--diff (i1 i2) (cl-loop for (t1 n1 s1) in i1 for (_t2 n2 s2) in i2 unless (=3D n1 n2) collect (list t1 (- n1 n2) (and s1 (- s1 s2))))) (defvar igc-stats--a nil) (defvar igc-stats--b nil) (defvar igc-stats--display-mode 'diff) (defun igc-stats-snapshot () (interactive) (if (eq igc-stats--display-mode 'a) (setq igc-stats--a (igc-info)) (setq igc-stats--b (igc-info))) (igc-stats)) (defun igc-stats--info-to-display () (cl-ecase igc-stats--display-mode (diff (igc-stats--diff igc-stats--b igc-stats--a)) (a igc-stats--a) (b igc-stats--b))) (defun igc-stats-display-diff () (interactive) (setq igc-stats--display-mode 'diff) (igc-stats)) (defun igc-stats-display-a () (interactive) (setq igc-stats--display-mode 'a) (igc-stats)) (defun igc-statis-display-b () (interactive) (setq igc-stats--display-mode 'b) (igc-stats)) (defun igc-stats-collect () "GC, then set snapsort B to current `igc-info'." (interactive) (let ((garbage-collection-messages t)) (igc--collect))) (defun igc-stats-clear () "GC, then set snapsort B to current `igc-info'." (interactive) (setq igc-stats--a nil igc-stats--b nil) (igc-stats)) (define-derived-mode igc-stats-mode special-mode "Statistics" (keymap-local-set "a" #'igc-stats-display-a) (keymap-local-set "b" #'igc-statis-display-b) (keymap-local-set "c" #'igc-stats-collect) (keymap-local-set "d" #'igc-stats-display-diff) (keymap-local-set "s" #'igc-stats-snapshot) (keymap-local-set "x" #'igc-stats-clear) (display-line-numbers-mode -1) (setq header-line-format '((:eval (format " %-35s %10s %15s" (concat "Display " (symbol-name igc-stats--display-mode)) "Objects" "Bytes")))) (setq-local revert-buffer-function (lambda (&rest _) (setq igc-stats--display-mode 'diff) (igc-stats-snapshot) (igc-stats)))) (defun igc-stats () "Display memory statistics from `igc-info'. You can display two snapshots A nd B containing the info from `igc-info' at different times. These can be displayed either as-is, or the difference between them. To take a snapshot, display it then take a snapshort. By reverting the buffer, take snapshot A, and display the changes to snapshot A. See the modes's help." (interactive) (with-current-buffer (get-buffer-create "*igc*") (igc-stats-mode) (setq buffer-read-only t buffer-file-name nil) (let ((info (igc-stats--info-to-display)) (inhibit-read-only t) (inhibit-modification-hooks t) (standard-output (current-buffer))) (erase-buffer) (delete-all-overlays) (when info (cl-loop for (title n bytes) in info do (insert (format "%-35s %10s %15s\n" title n bytes))) (sort-lines nil (point-min) (point-max))) (goto-char (point-min)))) (display-buffer "*igc*")) (provide 'igc-stats) --=-=-=--