You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "bd2019us (JIRA)" <ji...@apache.org> on 2019/04/30 03:40:00 UTC

[jira] [Resolved] (AMBARI-25241) Date.getTime() can be changed to System.currentTimeMillis()

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

bd2019us resolved AMBARI-25241.
-------------------------------
    Resolution: Later

> Date.getTime() can be changed to System.currentTimeMillis()
> -----------------------------------------------------------
>
>                 Key: AMBARI-25241
>                 URL: https://issues.apache.org/jira/browse/AMBARI-25241
>             Project: Ambari
>          Issue Type: Bug
>            Reporter: bd2019us
>            Priority: Major
>
> Location: contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/repo/BaseRepo.java:89
> Hello,
> I found that Date.getTime() can be changed to light method System.currentTimeMillis(),which can avoid creating the temporary Date object.
> new Date() is a thin wrapper of 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 (435ms vs 2073ms), when these two methods are invoked 5,000,000 times.



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