Issue #4017 has been updated by kou (Kouhei Sutou).

Status changed from Assigned to Feedback

We need some benchmark scripts based on `benchmark` library (or similar library) to work on speedup.

Can someone work on creating benchmark scripts?

----------------------------------------
Feature #4017: [PATCH] CSV parsing speedup
https://bugs.ruby-lang.org/issues/4017#change-70936

* Author: ender672 (Timothy Elliott)
* Status: Feedback
* Priority: Normal
* Assignee: kou (Kouhei Sutou)
* Target version: 
----------------------------------------
=begin
 ruby_19_csv_parser_split_methods.patch
 This patch breaks the CSV parser into multiple methods that are easier to understand and it allows for the performance optimizations in the second patch. It removes all regular expressions from the parser, resulting in a ~25% speed improvement in the CSV test suite. It adds a new CSV parser option, :io_read_limit, which determines the max size for IO reads. This option defaults to 2048 which to was the fastest in my benchmarks.
 
 ruby_19_csv_parser_split_methods.patch
 This patch adds two shortcuts to the patch above that significantly improve parsing of CSV files that have many quoted columns. It has to be applied on top of the first patch.
 
 On large CSV files I observed that these patches resulted in a 20% - 60% reduction of time it takes to parse. If this patchset looks good, I would like to experiment with further improvements that take advantage of io_read_limit to always read from IO in large chunks (right now it only does so with CSV files that have no quote characters).
 
 These patches maintain m17n support and multi-character separator support (and boy, it's tough to make those tests happy :)
=end


---Files--------------------------------
ruby_19_csv_parser_split_methods.patch (11.9 KB)
ruby_19_csv_parser_speedup.patch (1.82 KB)


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

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>