From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#65491: [PATCH] Improve performance allocating vectors Date: Sat, 26 Aug 2023 14:01:48 +0200 Message-ID: References: <87y1i0iwvu.fsf@localhost> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35417"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Stefan Monnier To: 65491@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 26 14:03:20 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qZs0e-00094D-If for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Aug 2023 14:03:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZs0J-00020i-B4; Sat, 26 Aug 2023 08:02:59 -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 1qZs0H-0001xV-Q1 for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2023 08:02:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZs0H-0004fT-HZ for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2023 08:02:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZs0M-0004zM-Li for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2023 08:03:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87y1i0iwvu.fsf@localhost> Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Aug 2023 12:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65491 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65491-submit@debbugs.gnu.org id=B65491.169305132519050 (code B ref 65491); Sat, 26 Aug 2023 12:03:02 +0000 Original-Received: (at 65491) by debbugs.gnu.org; 26 Aug 2023 12:02:05 +0000 Original-Received: from localhost ([127.0.0.1]:41822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZrzQ-0004xC-PZ for submit@debbugs.gnu.org; Sat, 26 Aug 2023 08:02:05 -0400 Original-Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]:44299) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZrzM-0004wc-DD for 65491@debbugs.gnu.org; Sat, 26 Aug 2023 08:02:02 -0400 Original-Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4fe27849e6aso2660991e87.1 for <65491@debbugs.gnu.org>; Sat, 26 Aug 2023 05:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693051309; x=1693656109; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=Om4K9CZlcyhtR9Rq4wlSQatF1DHKs7DPdgEbHn2VuYE=; b=CNBQ1PqM+YFspaf6S+ASpP2vPSPqkgzZxFf/QyB2DSSYTJOvh2cha6qz4/z1CCVhQw ZGZd5btBd9Bc0eXiVmzAyE2H/3OIqkDXCQT2EbQcWpAxxvYNDe8TU66kYhlBwIVDAD7O q1XMrIllwQXECTeHJDgcxsCisOFGihZgwu7NeQCNmBQW+MP2oN/8CzTQ1ITzfB65ZTAw YNC7LK5ctiIX1xC/FobX0AlI38dR9O/p+1jM33/+0V9hLUzd+/UpnZW4yyJiiFSyFPhh yS+Z0D089Fg8V/NI0Fge4S7vnSSuzoO1dP15HEn+XSY4/Lq+hJnf5sc0c2obXMjgBo2f i2kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693051309; x=1693656109; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Om4K9CZlcyhtR9Rq4wlSQatF1DHKs7DPdgEbHn2VuYE=; b=lahycCu61j1/kR3b2zs1HDpm6b1u0a2VnhcWDpmbBNhvn9dMJWmdhFcJRp1sEnFFVd AlB53UVmyyHS+T/P8n+GlFvKnku8Rl2KY90uLzNEvrLJlFRnFz0yV5XKyGJfewW4L7wS WjttpWThbjaNACJejQdyhzl/5NlvU9fbL4MccPvgGJHNEuMWmvOHmLEQK+zURp5Hr01R oIZrrBhDdStW2bjd8gri4uDd09QD7DkifnUlOO8kKYlSqi1eBK7nyTGrGl7QFgZv7P3o 0kQGSfGS6+sWSD3TjRlMk+onQRtxd2qfMgbBIq9x5B95bGzDtWKY5Gm/d1tt8bbBuiXw ifNQ== X-Gm-Message-State: AOJu0Yx3ugfcb8uH9rYC2yAaPouEiUaeSuUwOVNKpHG7Vg8l6IW15FWs 6lBR+hlOOMdBa0DdPbDxkHKF86rdovc= X-Google-Smtp-Source: AGHT+IFCyeuwtvCtxgN74apJ8n1evDPvcj9vVR9SPlyxacrsCYdSy/Qrf4TN3U1wY2P3y29gc0x/CQ== X-Received: by 2002:a05:6512:b1f:b0:4fc:3755:37d9 with SMTP id w31-20020a0565120b1f00b004fc375537d9mr16927028lfu.68.1693051309069; Sat, 26 Aug 2023 05:01:49 -0700 (PDT) Original-Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id z8-20020ac24188000000b004ff8e245260sm688761lfh.15.2023.08.26.05.01.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 26 Aug 2023 05:01:48 -0700 (PDT) X-Mailer: Apple Mail (2.3654.120.0.1.15) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268500 Archived-At: First of all, let's leave bignums out of this entirely. They are not = relevant here. Second, please do not motivate any perceived performance problem from = benchmarks found on the internet, especially anything derived from the = Gabriel benchmarks. This includes the benchmarks in ELPA. That said, vectorlike object allocation in general is definitely = relevant and can certainly be improved but I'm not persuaded by the = proposed patch. Please do not apply it right away. However, the important part is not the patch but the problem it = highlights, and here there is evidently plenty to do.=20 For example: - isn't vector_free_list twice as big as it needs to be? - 4096 bytes for vector blocks seems a tad small - to what extent are we duplicating the work done by modern libc = allocators (very generously including glibc here)? - not happy with the way struct vector_block co-allocates metadata with = a big power-of-two data chunk - next_vector is a dangerously unstable concoction of C undefined = behaviour and so on.