Performance intensive string splitting and manipulation in java

Posted by juhanic on Stack Overflow See other posts from Stack Overflow or by juhanic
Published on 2010-05-31T03:35:04Z Indexed on 2010/05/31 3:42 UTC
Read the original article Hit count: 266

What is the most efficient way to split a string by a very simple separator?

Some background:

I am porting a function I wrote in C with a bunch of pointer arithmetic to java and it is incredibly slow(After some optimisation still 5* slower). Having profiled it, it turns out a lot of that overhead is in String.split

The function in question takes a host name or ip address and makes it generic:

123.123.123.123->*.123.123.123

a.b.c.example.com->*.example.com

This can be run over several million items on a regular basis, so performance is an issue.

© Stack Overflow or respective owner

Related posts about java

Related posts about Performance