Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

performance trumps syntactical sugar #347

Merged
merged 1 commit into from Apr 29, 2011

Conversation

pkmiec
Copy link

@pkmiec pkmiec commented Apr 29, 2011

The options_for_select is invoking map(&:to_s) in loops. When options_for_select is invoked with many options, the memory impact of map(&:to_s) is more than necessary.

While map(&:to_s) stuff has been optimized, it is not free in ruby 1.8.7 and should yield way to performance.

Note, I made this request initially into rails:master (#346). This is the same change but into rails:3-0-stable instead, which is perhaps a better fit for this type of performance change.

@josevalim josevalim merged commit 92e4cfb into rails:3-0-stable Apr 29, 2011
vijaydev pushed a commit to vijaydev/rails that referenced this pull request Apr 29, 2011
performance trumps syntactical sugar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants