performance - how can i see which optimizations Java makes -


i have following code

 public boolean matches(string word) {       pattern p = pattern.compile("\\w$");      matcher m = p.matcher(word);      return m.find();   } 

i want know if java compiler substitutes pattern.compile("\w$") phrase object, or creates object every time function called.

how can find out java makes code?
there eclipse plugin shows this?

according source code, creates object every time function called.

public static pattern compile(string regex) {     return new pattern(regex, 0); } 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -