Actions
Feature #9952
closedOptimize object allocations in CSV::Row
Description
I'm seeing a large number of unnecessary array allocations where CSV zips headers & field values together for each row.
- We can reverse the zipped arrays in-place instead of re-allocating dup arrays.
- We can completely skip the reverse-zip remapping iteration when the number of headers and fields match (probably the common case).
This tiny patch should eliminate one extra temporary array object for every table cell, and saves some unnecessary looping.
Files
Updated by nagachika (Tomoyuki Chikanaga) over 10 years ago
- Status changed from Open to Assigned
Updated by Glass_saga (Masaki Matsushita) over 10 years ago
- Tracker changed from Bug to Feature
- Assignee changed from JEG2 (James Gray) to Glass_saga (Masaki Matsushita)
- Target version set to 2.2.0
Updated by Anonymous over 10 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
Applied in changeset r47663.
- lib/csv.rb: avoid unnecessary object allocations.
patch is from Andrew Vit. [ruby-core:63215] [Feature #9952]
Actions
Like0
Like0Like0Like0