Tag nameļ¼šcsv

Java Performance: Splitting Strings

I was working recently on a CSV parser needed for one of my personal projects.
The idea was simple, you have one (or more files) with over 1M lines of CSV data.
I only needed the last 3 fields and wanted to keep it simple, i had implemented a simple method which received a string and invoked its .split method.
Very nice and simple but the performance was very bad, with all the processing it took more than 30s to parse one file.

(more…)