Issue #9952 has been reported by Andrew Vit.

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

* Author: Andrew Vit
* Status: Open
* Priority: Normal
* Assignee: James Gray
* Category: lib
* Target version: 
* ruby -v: ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
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/