Replace all instances of ; in the rowparser loop with , ( ~15% speedup )
authorPeter Rabbitson <ribasushi@cpan.org>
Wed, 20 May 2015 13:25:06 +0000 (15:25 +0200)
committerPeter Rabbitson <ribasushi@cpan.org>
Wed, 20 May 2015 13:29:44 +0000 (15:29 +0200)
commit05a5ca4b941f0741e91d0972334ab96b96e13f4d
treefcf664b93d6410c0e037650a5df5fac7daaabd26
parent164aab8c48e5a055da6b395893fd10326961acee
Replace all instances of ; in the rowparser loop with , ( ~15% speedup )

The functional diff best examined via `... --color-words -w lib ...`

This is another microoptimization, which is nevertheless measurable on 1000+
row resultsets. Investigation into this was prompted by a curious comment made
by bulk88[1] in response to xdg[2]:

  Every ";" is an op that executes that adjusts current line number

Given that we already generate all this code, and it is not intended to be
read by a human, swapping ; with , is only logical. A (very very crude) check
with the included benchmarker indeed shows a repeatable difference on 5.16.2

[1] http://www.nntp.perl.org/group/perl.perl5.porters/2015/05/msg228074.html
[2] http://www.nntp.perl.org/group/perl.perl5.porters/2015/05/msg228068.html
examples/Benchmarks/semicolon_vs_comma_rowparser/comma.src [new file with mode: 0644]
examples/Benchmarks/semicolon_vs_comma_rowparser/semicol.src [new file with mode: 0644]
examples/Benchmarks/semicolon_vs_comma_rowparser/sloppy_bench.pl [new file with mode: 0644]
lib/DBIx/Class/ResultSource/RowParser/Util.pm
t/resultset/rowparser_internals.t