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: MPS: weak hash tables Date: Sat, 06 Jul 2024 22:00:08 +0200 Message-ID: References: <87msmu1uy5.fsf@gmail.com> <87cynq1sx0.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16411"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Helmut Eller , Eli Zaretskii , emacs-devel@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jul 06 22:01:08 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 1sQBam-000453-5N for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Jul 2024 22:01:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQBZx-0002k4-95; Sat, 06 Jul 2024 16:00:17 -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 1sQBZu-0002jY-RG for emacs-devel@gnu.org; Sat, 06 Jul 2024 16:00:14 -0400 Original-Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sQBZs-0001xA-5Z; Sat, 06 Jul 2024 16:00:13 -0400 Original-Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-52ea3e499b1so2260450e87.3; Sat, 06 Jul 2024 13:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720296010; x=1720900810; 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=TTvta4BkeKc1w1RJua+mT5jdWG6LbRoYdJZMrNETd/A=; b=LoAq0sLq4O33+WSxtciSYSmEkvkB94IXtQ931Aztir4a3RrOZ+4vgthCCcEJY/yc4p ktJ8xgvy6FpCrWj2rtfrZYwCYTQfY9dq20XLoUhH6JtdzQpPRu8vsMGHlr4JO3V9Y7Au jAm8twcVKv06J4SczQyqpWwzsl3tELsc3tKWOA/rK/qWqzdNhpLVJSlZYPc0dwHmboDd wL09BCcZmwURGXOrBkPYqBeKh18nlvInph1ut1xD23iSLIw6kMa4M1rF4pwyXqBv6QUd P8jKfDxHr+7GvPHKkT8CSA5f6U8WrFfVZWi6d57KoGw3sreHzTYV1z1SfRZHZBuCA2Sh s7iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720296010; x=1720900810; 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=TTvta4BkeKc1w1RJua+mT5jdWG6LbRoYdJZMrNETd/A=; b=QZJbTWIeYo6fIi/Vfgw9MlwyBVR3xG+fnyjbv+vDnLoczfgLj4QGJ9Qmq3J3CCVx/9 NS84fEggGokcDoCS7y2EMPzVu17vRPwjKzioXZ38rXf+YSwtvurjzV0iSF9fc6Zh+CwR Ke523aaK6KHaSye5YVjHXy6B5+ObmR/bg+PQNovxrrxsOwZ5vvqQK+vT8u/2wzFeHdZ0 XZSbVz0TtJIPAGfCylnekHJNJfWCVWAeHBdvEGTalL+yTpFWvxaQIIyby80aduR+flri VeTNT3IzZdvL5wHKGNXGOR1v7ukNWWapNbMbLBCsY0YnEor/1RuRQWHaKhA45Z//5Aai 2fXA== X-Forwarded-Encrypted: i=1; AJvYcCWQz+qZcbvHCRiRjlV71gjH+PqaV+TsH4ervqObQGU88mZ6+F42xtOMCyStFeeBWWprMMWyhH1HIyXp5BwujCu1YpE31rZIZQYtxfd4RfmDBPs= X-Gm-Message-State: AOJu0Yzg/CDvAOeCWCLW5VGdRa2rYyHQ2Eh4X+Wm4QdYPABulB4Yh6xH N3hQPKo5k+ovhfqUBGAY6YwqT7KVR/maKc19SwEgcjc1eLRDMPudGB4Xaw== X-Google-Smtp-Source: AGHT+IF8g+cBjeTKMrWwN2yDOGktWaiTGrFCSbIGHz52ifY4R8ga8XJBQfbGRyN1emRMcTJk8k0isQ== X-Received: by 2002:a05:6512:31ce:b0:52e:a60e:3a01 with SMTP id 2adb3069b0e04-52ea60e3befmr4306359e87.61.1720296009426; Sat, 06 Jul 2024 13:00:09 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a82e.dip0.t-ipconnect.de. [79.227.168.46]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a77ddc56700sm109918166b.67.2024.07.06.13.00.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jul 2024 13:00:09 -0700 (PDT) In-Reply-To: (Pip Cet's message of "Sat, 06 Jul 2024 18:30:04 +0000") Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=gerd.moellmann@gmail.com; helo=mail-lf1-x12e.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 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:321461 Archived-At: Pip Cet writes: >> What do the timings say? > > Horrible things. Unacceptably slow. Sufficiently so that I looked into > the generation parameters and randomly changed them, and now it's > faster than vanilla Emacs?! Does that make sense to you, or is it more > likely I'm being tricked by something silly like CPU speed? Good tension building :-) > > All I did was change: > > - mps_gen_param_s gens[] = { { 128000, 0.8 }, { 5 * 128000, 0.4 } }; > + mps_gen_param_s gens[] = { { 64000, 0.8 }, { 5 * 64000, 0.4 }, { 10 * 64000, 0.3 }, }; > > but that was a totally random guess... Wow, one of the knobs I always wanted to play with but couldn't figure out the rules :-). > Again, I may just be doing something wrong. Hm, what might be happening? I guess we can ignore the mortality because MPS says these values are only initial estimates, and it computes them itself over time. So, we had 14 * 64M total before, and 16 * 64M afterwards. A bit more makes sense since we now have GMP objects, but a dramatic improvement? The number of generations? Maybe MPS gets away, in the 3 gens case, with collecting gen1 and 2 most of the time if gen1 is not enough, which means 6 * 64, while in the 2 gens case, when it runs out of space in gen1 it directly has to handle gen1 + gen2 = 12 * 64M? That's the only thing I can come up with ATM. Complete guesswork, of course. I wonder how one would find an "optimal" configuration at all. Helmut, do you perhaps have an idea? And could one do something with telemetry to optimize generations? Do they mention something like that?