rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: Aaron Patterson <tenderlove@ruby-lang.org>
To: richard schneeman <richard.schneeman@gmail.com>
Cc: Aaron Patterson <tenderlove@ruby-lang.org>,
	Eric Wong <e@80x24.org>,
	rack-devel@googlegroups.com
Subject: Re: Less allocated objects on each request
Date: Fri, 17 Jun 2016 14:00:57 -0700	[thread overview]
Message-ID: <20160617210057.GD67772@TC.local> (raw)
In-Reply-To: <etPan.576452fa.7e7a0ff9.270f@Richards-MacBook-Air.local>

[-- Attachment #1: Type: text/plain, Size: 1748 bytes --]

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 string 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 cases. There are also some other constants buried around the project, this PR is only the main constants.
> 
> 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 `case`. Mostly why is the `case` code not faster than using a hash. Here is the discussion: 
> 
> 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.

-- 
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.

[-- Attachment #2: Type: application/pgp-signature, Size: 455 bytes --]

  reply	other threads:[~2016-06-17 21:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03 20:08 Less allocated objects on each request Eric Wong
2014-10-05  8:15 ` [PATCH] conditionalget: avoid const lookup in case/when Eric Wong
2014-10-05 21:37   ` James Tucker
2014-10-06 20:00     ` richard schneeman
2016-05-12  3:04       ` Less allocated objects on each request Eric Wong
2016-05-12 16:54         ` Aaron Patterson
2016-05-12 17:01           ` richard schneeman
2016-05-13 23:41           ` Eric Wong
2016-06-17 19:43             ` richard schneeman
2016-06-17 21:00               ` Aaron Patterson [this message]
2016-06-17 23:12                 ` Eric Wong
2016-06-17 23:19                   ` Aaron Patterson
2016-06-17 23:43                     ` Eric Wong
2014-10-05 21:31 ` James Tucker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://groups.google.com/group/rack-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160617210057.GD67772@TC.local \
    --to=rack-devel@googlegroups.com \
    --cc=e@80x24.org \
    --cc=richard.schneeman@gmail.com \
    --cc=tenderlove@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).