From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Status: No, score=-3.0 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from mail-qk0-f184.google.com (mail-qk0-f184.google.com [209.85.220.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id D55E520179 for ; Fri, 17 Jun 2016 21:01:02 +0000 (UTC) Received: by mail-qk0-f184.google.com with SMTP id r68sf34104015qka.1 for ; Fri, 17 Jun 2016 14:01:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=QxGuo3ao8RrnQip03mt5qup7yshr+ZKhF09MMgwiQ+0=; b=eVLOVG+s/oyoCm/+rIgQTSr5pkZ4dYER/PGB1uDq/2Fhn+jWV6rPeuB2+LTSM+zXjd GNGZk2zvL++7ItXUrrZGz4IxPRdAQrvLydQUx2xT2LnSoroAxIr46xpReg5bu7SlSa6s KisZ+e8pVsnzkT1OVT2Ol4B837KDiBJ1gFOOimOdZUjwsRzjro/OJ0BDzant3nXm+zHi mIFpLUEJ6sQseXcrC0vWcB/TgMY/nnCS7t6n5di+JpWdrB4Zprl6bwwMWUn5JxwM7kT6 LloR/7TEpr17UpAtma5MkWbw3V6fPCTmn3hnQOUeJOXocX/bteNISOIVd5Nw5nrALdsg Qd8w== X-Gm-Message-State: ALyK8tJSK2Bqz/G3gOQzoByknB4EJy9JH6KFZHeHAGzTT253Zq8l1El/aCfQt29CiyDtkg== X-Received: by 10.157.40.194 with SMTP id s60mr162577ota.5.1466197261824; Fri, 17 Jun 2016 14:01:01 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.157.43.181 with SMTP id u50ls946724ota.58.gmail; Fri, 17 Jun 2016 14:01:01 -0700 (PDT) X-Received: by 10.200.39.1 with SMTP id g1mr9866447qtg.17.1466197261172; Fri, 17 Jun 2016 14:01:01 -0700 (PDT) Received: from mail-pf0-x22e.google.com (mail-pf0-x22e.google.com. [2607:f8b0:400e:c00::22e]) by gmr-mx.google.com with ESMTPS id tp10si5703243pac.2.2016.06.17.14.01.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jun 2016 14:01:01 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c00::22e is neither permitted nor denied by best guess record for domain of aaron@tenderlovemaking.com) client-ip=2607:f8b0:400e:c00::22e; Received: by mail-pf0-x22e.google.com with SMTP id i123so30294407pfg.0 for ; Fri, 17 Jun 2016 14:01:01 -0700 (PDT) X-Received: by 10.98.101.71 with SMTP id z68mr4382401pfb.53.1466197260809; Fri, 17 Jun 2016 14:01:00 -0700 (PDT) Received: from TC.local (c-24-56-255-210.customer.broadstripe.net. [24.56.255.210]) by smtp.gmail.com with ESMTPSA id s65sm57736261pfd.23.2016.06.17.14.00.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jun 2016 14:01:00 -0700 (PDT) Sender: Aaron Patterson Date: Fri, 17 Jun 2016 14:00:57 -0700 From: Aaron Patterson To: richard schneeman Cc: Aaron Patterson , Eric Wong , rack-devel@googlegroups.com Subject: Re: Less allocated objects on each request Message-ID: <20160617210057.GD67772@TC.local> References: <20141003200836.GA4664@dcvr.yhbt.net> <20141005081525.GA8997@dcvr.yhbt.net> <20160512030454.GA10916@dcvr.yhbt.net> <20160512165456.GA79225@TC.local> <20160513234135.GA24167@dcvr.yhbt.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sXc4Kmr5FA7axrvy" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Original-Sender: aaron@tenderlovemaking.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@tenderlovemaking-com.20150623.gappssmtp.com; spf=neutral (google.com: 2607:f8b0:400e:c00::22e is neither permitted nor denied by best guess record for domain of aaron@tenderlovemaking.com) smtp.mailfrom=aaron@tenderlovemaking.com Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: X-Google-Group-Id: 486215384060 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , --sXc4Kmr5FA7axrvy Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 17, 2016 at 02:43:54PM -0500, richard schneeman wrote: > I have a PR that removes all those constants in rack.rb in favor of strin= g literals: > https://github.com/rack/rack/pull/1085 Eric, Here's a link to the raw diff if you want to take a look: https://patch-diff.githubusercontent.com/raw/rack/rack/pull/1085.diff Now that I'm reading this patch, removing the constants worries me because of backwards compatibility issues. I think removing the `freeze` is fine, and setting the magic comment to use frozen strings would be good. But removing the constants seems dangerous since other libraries use those constants. Could we just remove the freeze and add the magic comment to that file that defines the constants? > I also found some places where we should still use `.freeze` in a few cas= es. There are also some other constants buried around the project, this PR = is only the main constants. >=20 > Eric & Aaron: on a separate non-rack note, I could use some of your Ruby = internals expertise on a performance tuning patch to Sprockets involving `c= ase`. Mostly why is the `case` code not faster than using a hash. Here is t= he discussion:=C2=A0 >=20 > https://github.com/rails/sprockets/pull/312#issuecomment-226369234 I left a comment. Basically the case statement is doing an is_a? where the hash version is just doing an equality on the class. --=20 Aaron Patterson http://tenderlovemaking.com/ --=20 ---=20 You received this message because you are subscribed to the Google Groups "= Rack Development" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to rack-devel+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout. --sXc4Kmr5FA7axrvy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJXZGUJAAoJEJUxcLy0/6/GE8YH/jEjNe4SuJmtUem3TBoRkSei a3nHzmtDNbkrtOtHPJ/S8Gy1HMoriMRX30ZcAGmoQhtQy26n0epI1d3+nb6u3tB7 4FYxewP15wuYZbuPYomspURF58ZprNY1Kss1tBB8uCXSw/cxbOhRM+4qSXNlc6WP 7mg/tPoutIFQuJTWNGluvg4rK1tQpm8RoQL05TOGax5i2zDY8+SWF/gsvxXxot5A RVgK2rd6NSYQhEss6u6b2bLIirmr52weS+76fnzh8Wl0Z2e8vMOgvHj9Q7Xk1qM7 WXzmk0cOcKHRl/HicshtRowmRjSE8s/rXsmQI8/jJGf4XesmpLiZnBH1mJpuVd0= =X1i4 -----END PGP SIGNATURE----- --sXc4Kmr5FA7axrvy--