I am currently working on a project where I am parsing data line-by-line. I only need parts of each line so I am splitting on spaces to extract the string tokens and then continue on. I have already created a compiled Pattern and am using Pattern's split instead of String's version. I did this because I have to split on " +" because the spacing is not consistent between tokens.
My problem is split is still taking too long. The split required for each line is using up almost all of the execution time and this program needs to run fast. And before you say "use C++!" I'm limited to using Java for this due to cross-platform needs.
So, is there a faster implementation of split out there? Or an alternative way to do it? I know StringTokenizer is faster but it's not exactly recommended these days and I need the regex capability of split obviously.
My problem is split is still taking too long. The split required for each line is using up almost all of the execution time and this program needs to run fast. And before you say "use C++!" I'm limited to using Java for this due to cross-platform needs.
So, is there a faster implementation of split out there? Or an alternative way to do it? I know StringTokenizer is faster but it's not exactly recommended these days and I need the regex capability of split obviously.