bd2019us created AMBARI-25241:
---------------------------------

             Summary: 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


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)

Reply via email to