"be consistent" | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
OK, more specific The module is Text::CSV_XS (surprise), and the new feature is support for multi-byte sep_char which includes the support of UTF-8 separation characters. The fact that it is the separation character that can now allow a character instead of a single byte implies a huge impact. The first check on every byte in a CSV stream is the check on the separation character. Every extra test on that byte will cause that extra test to be executed for every single byte in the stream. This is still the fastest way. Making that check conditional on the state of the stream will just cause another (or more) test to be executed instead. The performance drop for the fastest stream test I do is measured between 5 and 10%. For all versions of perl I tested with. At this moment, I think it is worth it, but I am still in doubt. $ perl -MCSV -C3 -E'csv (out => *STDOUT, in => [[ 1, 2 ]], sep => "\x{060c}")' 1،2 $ perl -MCSV -C3 -E'csv (out => *STDOUT, in => [[ 1, 2 ]], sep => "\N{FULLWIDTH COMMA}")' 1,2 $ perl -MCSV -C3 -E'csv (out => *STDOUT, in => [[ 1, 2 ]], sep => "\N{FULLWIDTH COMMA}")' | \ perl -MCSV -E'DDumper (csv (in => *STDIN, sep => "\x{ff0c}"))' [ [ 1, 2 ] ] $ Enjoy, Have FUN! H.Merijn In reply to Re: Speeds vs functionality
by Tux
|
|