This project is archived and is in readonly mode.

#4191 ✓resolved
James Golick

Performance improvements to multibyte utils

Reported by James Golick | March 16th, 2010 @ 05:01 PM | in 3.0.2

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 master, which reduces the amount of garbage by about 70%. I backported that change to 2-3-stable:

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

and backported that too:

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>