From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id DF6EB1F44D for ; Tue, 16 Apr 2024 10:11:47 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=q0gsHSVK; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=jugb6D32; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 5997C84347; Tue, 16 Apr 2024 10:11:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1713262299; bh=UNo7tzBZBt0vvMwBbU4b7JbR6DfL1GjmnW/Jc2sSw1U=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=q0gsHSVK5L1yxwbs1PMkGFVsGilv0KQDCjrwZ4HIgdeDrJZPn2M+E1fi1mbeIR5mG Gcss5ycYJrqnht+beuhOq2CUKrUNFZZuJ4swvKA0LuyMjRLSE+Xo2E8TtChlujPcQB c8XTsPfJ6BfbXRJMq4VMw3crhv8t3lsgraBpbWHA= Received: from s.wrqvtbkv.outbound-mail.sendgrid.net (s.wrqvtbkv.outbound-mail.sendgrid.net [149.72.123.24]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 767BF84319 for ; Tue, 16 Apr 2024 10:11:36 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=jugb6D32; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=+LnaNbMNBEuJBTL9GioE4GRK9P1RsLw8EyN8gUL7yis=; b=jugb6D32qXqjHqkehl3v15x9CI1EcU6+1+tPj7bOdJybOHvvwfJZfjecJ5cA6OhdC8C+ kCsFUe6ohshVr/z0XXWUOJZgsPk15MVOagc3kR8eQ7UCpn+zzXLLBBoxGhd3Sor26nZ4i/ 3f0ERjS7qrz1y1BhBE2qLidHfsAfVaiEjpjLhUoqvUKZwSSIuVpcBvijvy2thaR2Pt5sVv ds8XG293qgnGVAi01Q9gaqeRQbloJ4FWZmOKHdkFvz2LVH0FIkODVRQH/dq039I2eC4vge uqdyRBS+jZHq6IfqIoKtuZysOT3unwzOg3WPD8Z4ijmixXwHPo+JSoE6ThXrW4rA== Received: by recvd-bb7996b79-fc94m with SMTP id recvd-bb7996b79-fc94m-1-661E4ED7-E 2024-04-16 10:11:35.431341157 +0000 UTC m=+303039.216326130 Received: from herokuapp.com (unknown) by geopod-ismtpd-38 (SG) with ESMTP id vczq1DdoTA-LRV6qDweNig for ; Tue, 16 Apr 2024 10:11:35.413 +0000 (UTC) Date: Tue, 16 Apr 2024 10:11:35 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 20429 X-Redmine-Issue-Author: byroot X-Redmine-Issue-Priority: Normal X-Redmine-Sender: Eregon X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 94124 X-SG-EID: =?us-ascii?Q?u001=2EByjZWvxTCjdoV8K03xEuhE7KqN4thWULFLM7+oH78KY30oYB3qFthsDpL?= =?us-ascii?Q?4w4cbYa3ttBh8bAHPOnE=2FkzPba67JNu7Lnrked2?= =?us-ascii?Q?O7K9VQ=2FJax0FOmqU5mELaTybfqZZrRTu9L4Xmwm?= =?us-ascii?Q?T8DeaCPSBm+pZ+W7omM=2Fq5wEYhnOxNlOfaP3KKI?= =?us-ascii?Q?6130x4E60PqcpC=2FzYdkspdPo70ah+h5xmYCNdN4?= =?us-ascii?Q?ZbKU5iq6jN3vZp7KSlXMbwmnXGxmwl4V2XFAGt1?= =?us-ascii?Q?Sux=2FZI5V=2FtbETw6vmcOpQEhX0Q=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: KP2XCPJKYNL5WCKPP7HHSULLVNYUZ6A5 X-Message-ID-Hash: KP2XCPJKYNL5WCKPP7HHSULLVNYUZ6A5 X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:117529] [Ruby master Feature#20429] Emit a performance warning when specially optimized core methods are redefined List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "Eregon (Benoit Daloze) via ruby-core" Cc: "Eregon (Benoit Daloze)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20429 has been updated by Eregon (Benoit Daloze). +1, great idea. I will likely do the same in TruffleRuby (there is already a way to find out via `--engine.TraceAssumptions` but that's more general and less user-friendly). ---------------------------------------- Feature #20429: Emit a performance warning when specially optimized core methods are redefined https://bugs.ruby-lang.org/issues/20429#change-107919 * Author: byroot (Jean Boussier) * Status: Open ---------------------------------------- MRI has a number of core methods with special handling in the interpreter and both JITs that if they are redefined negatively impact Ruby performance. The methods currently are (I may be missing a few): - `Integer`: `#+`, `#-`, `#*`, `#/`, `#%`, `#<`, `#>`, `#<=`, `#>=` - `Float`: `#+`, `#-`, `#*`, `#/`, `#<`, `#>`, `#<=`, `#>=` - `String`: `#freeze`, `#size`, `#length`, `#empty?`, `#+`, `#succ`, `#%`, `#-@` - `Array`: `#size`, `#length`, `#empty?`, `#hash` - `Array`: `#size`, `#length`, `#empty?`, `#[]`, `#[]=` Noticing that a dependency do redefine one of these methods can be non-trivial, so I'd like to emit a `:performance` warning when it happens. I can't really think of much reasons to redefine these aside from fun hacks, so I believe discouraging it would be valuable. Patch: https://github.com/ruby/ruby/pull/10532 -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/