peformance trumps syntactical sugar #346

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@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 and should yield way to performance.

@dhh
Member
dhh commented Apr 29, 2011

Do you have some benchmarks showing the impact of this on Ruby 1.9? It's my understanding that &:symbol is essentially free under 1.9, which is the primary target for master.

@pkmiec
pkmiec commented Apr 29, 2011

Ah .. no, I have not made it to 1.9 yet .. still on 1.8.7. Should I submit this for the 3.0.7 branch instead?

@dhh
Member
dhh commented Apr 29, 2011

Yeah, that'd be a better fit.

@pkmiec pkmiec closed this Apr 29, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment