Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.3
-
None
-
None
Description
Most Velocity compare expressions eventually use ASTComparisonNode which at first attempts to treat data types as numbers:
Boolean result = compareNumbers(left, right);
if (result == null)
There is fairly large overhead when attempting to create BigDecimal from non-numeric strings used in comparison in the DuckType.asNumber:
if (coerceType)
{
String string = asString(value);// coerce to string
if (string != null)
}
The exception is created capturing stack, etc. On large volume of compare operations it's very visible.