Sometimes you can either do the wrong thing quickly, or do the right thing slowly. This is one of those times. Unicode support slows down a lot of matching operations because character class matching isn't just a matter of looking at bits in 256-entry bitmaps anymore.<div>
<br></div><div>I would, however, check whether you have Text::CSV_XS installed, as it's faster than the pure-perl Text::CSV, and its speed is probably less-affected by Unicode.<br><br><div class="gmail_quote">On Thu, Jan 26, 2012 at 3:58 PM, tiger peng <span dir="ltr"><<a href="mailto:tigerpeng2001@yahoo.com">tigerpeng2001@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:arial,helvetica,sans-serif"><div>Hello all,<br></div><div><br></div><div>I just made a Perl script for parsing large CSV files (with Text::CSV). When I enable Unicode  (with the three use uncommented), it took as twice longer time. Is it normal? Is there any way to speed it up? <br>
</div><div><br></div><div>Thanks,</div><div><br></div><div><span style="font-weight:bold;font-family:Courier New,courier,monaco,monospace,sans-serif">#use utf8;</span><br style="font-weight:bold;font-family:Courier New,courier,monaco,monospace,sans-serif">
<span style="font-weight:bold;font-family:Courier New,courier,monaco,monospace,sans-serif">#use encoding "utf-8";</span><br style="font-weight:bold;font-family:Courier New,courier,monaco,monospace,sans-serif"><span style="font-weight:bold;font-family:Courier New,courier,monaco,monospace,sans-serif">#use open
 ':encoding(utf8)';</span></div></div></div><br>_______________________________________________<br>
Chicago-talk mailing list<br>
<a href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/chicago-talk" target="_blank">http://mail.pm.org/mailman/listinfo/chicago-talk</a><br></blockquote></div><br></div>