Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #8812 (closed defect: invalid)

Opened 1 year ago

Last modified 1 year ago

[PATCH][DOC] Add a warning note about evils of enumerator(&:symtoproc)

Reported by: lifofifo Assigned to: core
Priority: normal Milestone: 1.x
Component: ActiveSupport Version: edge
Severity: normal Keywords: docs
Cc:

Description

Using something like Tag.find(:all).map(&:name) surely looks ub3r c0o1.

But the symbol to proc conversion might be very costly in cases like this.

This patch adds a tiny note about the same. I've also added some benchmarking results.

Attachments

perform.rb (0.6 kB) - added by lifofifo on 06/29/07 19:30:56.
enum_to_proc_note.patch (0.7 kB) - added by lifofifo on 06/29/07 19:31:59.
Add a performance note for usages like map(&:name)

Change History

06/29/07 19:30:56 changed by lifofifo

  • attachment perform.rb added.

06/29/07 19:31:59 changed by lifofifo

  • attachment enum_to_proc_note.patch added.

Add a performance note for usages like map(&:name)

06/29/07 22:17:49 changed by lifofifo

Pure ruby example of the same problem.

06/30/07 13:06:13 changed by lifofifo

  • status changed from new to closed.
  • resolution set to invalid.

Please check 8818

Thanks.