The IO involved in opening/closing/reading/writing those files is probably where you are spending the most of your time in those benchmarks. Since you're doing the same amount of IO in both test, it should affect which one is faster, but it does affect the ratio of sped between the two tests (just like adding a sleep(1) to both makes them both equally sucky)
If you really want to test *only* the CSV time, you can read from a tied filehandle that's really just a string in memory; and write to a tied filehanlde that just throws away the data you write to it.
take a look at Tie::FileHandle::Base the replies to this post as a place to start
In reply to Re: Benchmark comparison of Text::xSV and Text::CSV_XS
by hossman
in thread Benchmark comparison of Text::xSV and Text::CSV_XS
by jZed
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |