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, 12 Aug 2015 12:30:38 +0000 (14:30 +0200)
commitd43f17348d467a630a0f6c9eb7ffe9734e4b94f6
tree10dcba1270c94f146bbdc8138cbfdd026ee782fe
parent8e06d750f0970fad6ce207781c837ead659204b7
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 Glenn Golden[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