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=-2.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from mail-it0-f57.google.com (mail-it0-f57.google.com [209.85.214.57]) (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 6CA9E1FEAA for ; Fri, 17 Jun 2016 23:19:17 +0000 (UTC) Received: by mail-it0-f57.google.com with SMTP id z189sf1530839itg.1 for ; Fri, 17 Jun 2016 16:19:17 -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=HaM77iAQrDJadBrR32HKmVr0sIhDJCnr7fZYx7yoI+8=; b=SdhHJqCyayZPkbto98l4alMsA8LInoaxYNPQLr6wxKRIpSh92wWWmKA7cw8qmf7OLD hTQWBRFTwvHvfT3BrG0TD6TxjE9ayw72vBTIFA2Q9FLc5sY6dHheaNPDnZloL1JO/mjz EK0jYYVJlYeRfzQWntJ2CtS0qPHcGzhLsfY8IBe25J+zpOunSuCkgi8J1RxKGYwr2P8S 6XrEz4cgu0d7ZIIFJMY4O5BJ26FRVVGDWXfX0DTMX5fkNnVOYpcZ7lay8a42TKlnBRIX /tRS+Twvk43U2t8QKsiJfqDZv2ZRgzTm79b6qhHZ7iDyYtC7ugPaw5Bm1tvoB+LmjFHP Dq3Q== X-Gm-Message-State: ALyK8tIzTNbHmyfeQ5voXUthWPuNbR2n5kjJ+ERceowL0sNXQEbnTag0h1/wX5g5MraLmg== X-Received: by 10.157.37.168 with SMTP id q37mr178813ota.13.1466205556705; Fri, 17 Jun 2016 16:19:16 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.157.33.25 with SMTP id i25ls1044269otb.86.gmail; Fri, 17 Jun 2016 16:19:16 -0700 (PDT) X-Received: by 10.157.11.39 with SMTP id a36mr6484407ota.2.1466205556257; Fri, 17 Jun 2016 16:19:16 -0700 (PDT) Received: from mail-pa0-x231.google.com (mail-pa0-x231.google.com. [2607:f8b0:400e:c03::231]) by gmr-mx.google.com with ESMTPS id tp10si5755365pac.2.2016.06.17.16.19.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jun 2016 16:19:16 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::231 is neither permitted nor denied by best guess record for domain of aaron@tenderlovemaking.com) client-ip=2607:f8b0:400e:c03::231; Received: by mail-pa0-x231.google.com with SMTP id bz2so32453777pad.1 for ; Fri, 17 Jun 2016 16:19:16 -0700 (PDT) X-Received: by 10.66.249.161 with SMTP id yv1mr5124233pac.39.1466205555919; Fri, 17 Jun 2016 16:19:15 -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 yp4sm36747415pab.48.2016.06.17.16.19.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jun 2016 16:19:15 -0700 (PDT) Sender: Aaron Patterson Date: Fri, 17 Jun 2016 16:19:11 -0700 From: Aaron Patterson To: rack-devel@googlegroups.com Cc: Aaron Patterson , richard schneeman Subject: Re: Less allocated objects on each request Message-ID: <20160617231911.GA87608@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> <20160617210057.GD67772@TC.local> <20160617231239.GA16185@dcvr.yhbt.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline In-Reply-To: <20160617231239.GA16185@dcvr.yhbt.net> 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:c03::231 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: , --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline On Fri, Jun 17, 2016 at 11:12:39PM +0000, Eric Wong wrote: > The following also breaks the opt_case_dispatch optimization so > it becomes a linear scan, but it still avoids allocating: > > case value.class.to_s > when "String".freeze, "Symbol".freeze > when "Array".freeze > something > else > something_else > end Huh. I didn't know adding the `freeze` would kill the optimization. Seems like we could fix that, though I'm not sure why anyone would do this. You can't access the strings anyway so freezing seems pointless (maybe even warning worthy?) -- Aaron Patterson http://tenderlovemaking.com/ -- --- 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 email to rack-devel+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout. --SLDf9lqlvOQaIe6s Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJXZIVvAAoJEJUxcLy0/6/GZ5oIAIzLO8LcsCWJQWsB2bDOftkF SXRZopGAcyUpc7ozqbtYSRvsLXoxwsKP/TsQgSgztAShca2y0Fm3hqmyhgG6pfko iWgJkH5WclovZr5PJPyQhTF5E5zpvUOSl1ezCE2zMhrvn5dqA0C+ELCgFFJAoHO1 nJeneS5uqHJGSqIMlRmISCz4DrWgdpRqT3/URA0CMjpqVe060X8s1ABez63+touE d6u0ce3kn6BREtAAZLp7Eh14N1kNvCNjxs2rmIRyJWH4WDQPw+0k8iKh+2/nB5Cp fdv4If/3f3qteCz9KZoDqsE9rF4TnPt8KuqIE8oiO84j5D0ac0CPwphkAdDKC8U= =ojYp -----END PGP SIGNATURE----- --SLDf9lqlvOQaIe6s--