Inefficient code of String.indexOf(String)

2013-06-24 Thread Anubhav Chaturvedi
Hello, I have recently started to explore the source code and am new to the open source community. I observed that in String.class within java.lang , the indexOf method, line 1715, uses the bruteforce approach when it comes to string matching. This method is used by the contains(CharSequence) meth

Re: Inefficient code of String.indexOf(String)

2013-06-17 Thread Anubhav Chaturvedi
Thank you all for the quick response. I will perform some tests and get in touch again asap. On Jun 17, 2013 10:45 PM, "David Chase" wrote: > For sufficiently large strings, indexOf can also be profitably > parallelized. > > David > > On 2013-06-17, at 2:14 AM, Martin Buchholz wrote: > > > You a

Re: Inefficient code of String.indexOf(String)

2013-06-17 Thread David Chase
For sufficiently large strings, indexOf can also be profitably parallelized. David On 2013-06-17, at 2:14 AM, Martin Buchholz wrote: > You are not the first person to have this idea. > It is unlikely that you will succeed in changing the algorithm, because the > jit-optimized brute-force algori

Re: Inefficient code of String.indexOf(String)

2013-06-16 Thread Aleksey Shipilev
Hi Anubhav, On 16.06.2013, at 14:53, Anubhav Chaturvedi wrote: > I would like to bring the required changes and needed your advice on this. Welcome to OpenJDK! Please read through OpenJDK contributors page for the process we follow: http://openjdk.java.net/contribute/ It would be great if y

Re: Inefficient code of String.indexOf(String)

2013-06-16 Thread Alan Bateman
On 16/06/2013 11:53, Anubhav Chaturvedi wrote: Hello, I have recently started to explore the source code and am new to the open source community. I observed that in String.class within java.lang , the indexOf method, line 1715, uses the bruteforce approach when it comes to string matching. This

Inefficient code of String.indexOf(String)

2013-06-16 Thread Anubhav Chaturvedi
Hello, I have recently started to explore the source code and am new to the open source community. I observed that in String.class within java.lang , the indexOf method, line 1715, uses the bruteforce approach when it comes to string matching. This method is used by the contains(CharSequence) meth