[ 
https://issues.apache.org/jira/browse/LANG-1151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Juan Pablo Santos Rodríguez updated LANG-1151:
----------------------------------------------
    Attachment: benchmark-lang1151.zip

Hi [~britter],

please see attached maven project with the benchmark, it is adapted from the 
one at http://jdevelopment.nl/efficient-determine-string-number/ 

Running it several times yields consistent results, f.ex.:

{code}
isNumberWithParseLong: 21350 ms
isNumberWithIsDigit: 610 ms
isNumberWithRegex: 2688 ms
isParsable34: 1972 ms
isParsable: 736 ms
{code}

(although {{isNumberWithIsDigit}} is faster, I suspect it's because it doesn't 
handle the decimal point)

br,
juan pablo

> Performance improvements for NumberUtils.isParsable
> ---------------------------------------------------
>
>                 Key: LANG-1151
>                 URL: https://issues.apache.org/jira/browse/LANG-1151
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.math.*
>    Affects Versions: 3.4
>            Reporter: Juan Pablo Santos Rodríguez
>         Attachments: benchmark-lang1151.zip
>
>
> NumberUtils.isParsable contains String comparisons + some String replacing, 
> which could be improved in terms of performance. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to