Project

General

Profile

Actions

Feature #9952

closed

Optimize object allocations in CSV::Row

Added by avit (Andrew Vit) almost 10 years ago. Updated over 9 years ago.

Status:
Closed
Target version:
[ruby-core:63215]

Description

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) csv-20140618.patch Optimization for CSV Row avit (Andrew Vit), 06/18/2014 08:46 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0