Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

This project is archived and is in readonly mode.

Performance improvements to multibyte utils

#4191

In the 2-3-stable branch, the ActiveSupport::Multibyte.clean() was doing this:

stripped = []; for c in string.split(//)
  stripped << c if expression =~ c
end; stripped.join

That was creating tons of garbage. Actually, it was the single biggest creator of garbage in our requests (around 4500-6000 objects).

It was replaced with

string.split(//).grep(expression).join

...in master, which reduces the amount of garbage by about 70%. I backported that change to 2-3-stable:

http://github.com/jamesgolick/rails/commit/ff2f98173d398cc40f5d6e2f...

And I also added a patch of my own to reduce the amount of garbage in ActiveSupport::Multibyte.verify():

http://github.com/jamesgolick/rails/commit/eb96874f97b8e11f37f9c6c7...

and backported that too:

http://github.com/jamesgolick/rails/commit/69a5cad7f7c7d6f7498dd87a...

Reported by James Golick · March 16th, 2010 @ 05:01 PM

State: resolved
Milestone: 3.0.2
Assigned to: nobody
Importance: Low

Activity

  1. Yehuda Katz (wycats)
    Yehuda Katz (wycats)
    • State changed from new to resolved
    • Tag changed from performance to performance, rails3
    • Milestone cleared.

    March 27th, 2010 @ 08:47 AM

  2. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to Low

    October 15th, 2010 @ 11:01 PM