Hi,
When dealing with big text files and large directories of files that you need to search / parse, I was wondering if anyone knows how much faster C++ is than Perl approximately? Is it worth it to develop in C++ over Perl in these cases?
FRo
Printable View
Hi,
When dealing with big text files and large directories of files that you need to search / parse, I was wondering if anyone knows how much faster C++ is than Perl approximately? Is it worth it to develop in C++ over Perl in these cases?
FRo
Perhaps not.
It would depend on the target machine to some degree, but in modern hardware (this side of a single core 1Ghz chip), a C++ version would probably leave the CPU so idle, depending on what you mean by parsing, that the bottleneck is likely the read speed and random access time of the file system.
That said, if the parsing is demanding then that portion of a C++ version would be more efficient and possibly faster. Without more detail as to what you're parsing and doing with the results, I can't be more specific.
My experience is that C++ is 2-10 times faster.
However, my experience is based on data processing, where the files were read and written using an API (which was written in C). And as a matter of fact, in this scenario the opposite of what JVene posted was true: The lighter the processing the more significant the difference was (due to the fact that the penalty for reading a file via a C API became bigger when the actual processing was lighter). I don't think, the above will hold true though for processing where the file is read/written using the language's native functions.