You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "bd2019us (JIRA)" <ji...@apache.org> on 2019/04/12 19:15:00 UTC

[jira] [Updated] (NETBEANS-2408) Date.getTime() can be changed to System.currentTimeMillis()

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

bd2019us updated NETBEANS-2408:
-------------------------------
    Description: 
Hello,
I found that System.currentTimeMillis() can be used here instead of new Date.getTime().
Since new Date() is a thin wrapper of light method System.currentTimeMillis(). The performance will be greatly damaged if it is invoked too much times.
According to my local testing at the same environment, System.currentTimeMillis() can achieve a speedup to 5 times (435 ms vs 2073 ms), when these two methods are invoked 5,000,000 times.

  was:
enterprise/j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/AppClientProvider.java 413

Hello,
I found that System.currentTimeMillis() can be used here instead of new Date.getTime().
Since new Date() is a thin wrapper of light method System.currentTimeMillis(). The performance will be greatly damaged if it is invoked too much times.
According to my local testing at the same environment, System.currentTimeMillis() can achieve a speedup to 5 times (435 ms vs 2073 ms), when these two methods are invoked 5,000,000 times.


> Date.getTime() can be changed to System.currentTimeMillis()
> -----------------------------------------------------------
>
>                 Key: NETBEANS-2408
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-2408
>             Project: NetBeans
>          Issue Type: Bug
>            Reporter: bd2019us
>            Priority: Major
>
> Hello,
> I found that System.currentTimeMillis() can be used here instead of new Date.getTime().
> Since new Date() is a thin wrapper of light method System.currentTimeMillis(). The performance will be greatly damaged if it is invoked too much times.
> According to my local testing at the same environment, System.currentTimeMillis() can achieve a speedup to 5 times (435 ms vs 2073 ms), when these two methods are invoked 5,000,000 times.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists