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
Post a Comment