Issue #9952 has been updated by Masaki Matsushita.

Tracker changed from Bug to Feature
Assignee changed from James Gray to Masaki Matsushita
Target version set to current: 2.2.0

----------------------------------------
Feature #9952: Optimize object allocations in CSV::Row
https://bugs.ruby-lang.org/issues/9952#change-49024

* Author: Andrew Vit
* Status: Assigned
* Priority: Normal
* Assignee: Masaki Matsushita
* Category: lib
* Target version: current: 2.2.0
----------------------------------------
I'm seeing a large number of unnecessary array allocations where CSV zips headers & field values together for each row.

1. We can reverse the zipped arrays in-place instead of re-allocating dup arrays.
2. 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--------------------------------
csv-20140618.patch (497 Bytes)


-- 
https://bugs.ruby-lang.org/