java - BigDecimal constructor performance - string vs numeric -
new bigdecimal("10000"); new bigdecimal(10000);
i know string constructor used if number bigger compiler accept, either of constructors faster other?
you can @ source code.
public bigdecimal(int val) { intcompact = val; } public bigdecimal(string val) { this(val.tochararray(), 0, val.length()); } public bigdecimal(char[] in, int offset, int len) { ...very long }
obviously, faster.
Comments
Post a Comment