From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 7E5EA1F4B4 for ; Sat, 26 Dec 2020 12:53:55 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id E511A120B98; Sat, 26 Dec 2020 21:53:06 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 40768120B92 for ; Sat, 26 Dec 2020 21:53:04 +0900 (JST) Received: by filterdrecv-p3iad2-74bd9fb996-mzbxp with SMTP id filterdrecv-p3iad2-74bd9fb996-mzbxp-20-5FE7325C-31 2020-12-26 12:53:48.923473515 +0000 UTC m=+1345896.992967886 Received: from herokuapp.com (unknown) by ismtpd0045p1mdw1.sendgrid.net (SG) with ESMTP id 567nnz7KSASXpxvULDvcKQ for ; Sat, 26 Dec 2020 12:53:48.840 +0000 (UTC) Date: Sat, 26 Dec 2020 12:53:48 +0000 (UTC) From: eregontp@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 77613 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 17472 X-Redmine-Issue-Author: naruse 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-SG-EID: =?us-ascii?Q?KippOI8ZHtTweq7XfQzW93937kJ4QNWwSBuHnaMEcr1SwhM9bJwvBPHx9vzfmJ?= =?us-ascii?Q?tZh2ebSZFW2Fs0zxzq=2FmzBCYaZuHxu1rkBv2Zcl?= =?us-ascii?Q?H1rwbhEZLa5VgCT97tg4Z7uGqmbc8l9U7tnPYeA?= =?us-ascii?Q?P1NK7uuQzMMWfX912TG2cSsIenM8NTEj0La568o?= =?us-ascii?Q?uGkq1knE1Q9eTpQOSLnSok3gn74Jx5mUdWsv3dv?= =?us-ascii?Q?kfyXD8ZKmqmCsGRvs=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 101713 Subject: [ruby-core:101713] [Ruby master Feature#17472] HashWithIndifferentAccess like Hash extension X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #17472 has been updated by Eregon (Benoit Daloze). Isn't a C extension in a gem enough? Also what specifically would writing it in C instead of Ruby gain? Intuitively I'd think there would be no significant gain to write it in C. Is there any profile showing a significant amount of time is spent in HashWithIndifferentAccess? Also, the semantics of `HashWithIndifferentAccess` IMHO don't fit the collection design of the core library. And the name doesn't really fit with other class names in the core library. ---------------------------------------- Feature #17472: HashWithIndifferentAccess like Hash extension https://bugs.ruby-lang.org/issues/17472#change-89536 * Author: naruse (Yui NARUSE) * Status: Open * Priority: Normal * Target version: 3.1 ---------------------------------------- Rails has [ActiveSupport::HashWithIndifferentAccess](https://api.rubyonrails.org/classes/ActiveSupport/HashWithIndifferentAccess.html), which is widely used in Rails to handle Request, Session, ActionView's form construction, ActiveRecord's DB communication, and so on. It receives String or Symbol and normalize them to fetch the value. But it is implemented with Ruby. If we provide C implementation of that, Rails will gain the performance improvement. -- https://bugs.ruby-lang.org/