[ 
https://issues.apache.org/jira/browse/HIVE-21611?focusedWorklogId=465108&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-465108
 ]

ASF GitHub Bot logged work on HIVE-21611:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 31/Jul/20 17:45
            Start Date: 31/Jul/20 17:45
    Worklog Time Spent: 10m 
      Work Description: HunterL commented on a change in pull request #1334:
URL: https://github.com/apache/hive/pull/1334#discussion_r463745530



##########
File path: 
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/ZooKeeperCleanup.java
##########
@@ -149,7 +147,7 @@ public boolean checkAndDelete(String node, CuratorFramework 
zk) {
       JobStateTracker tracker = new JobStateTracker(node, zk, true,
         appConf.get(TempletonStorage.STORAGE_ROOT +
           ZooKeeperStorage.TRACKINGDIR));
-      long now = new Date().getTime();
+      long now = System.currentTimeMillis();

Review comment:
       Same story as the call in `HDFSCleanup`, this is used for comparison




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 465108)
    Time Spent: 1h 20m  (was: 1h 10m)

> Date.getTime() can be changed to System.currentTimeMillis()
> -----------------------------------------------------------
>
>                 Key: HIVE-21611
>                 URL: https://issues.apache.org/jira/browse/HIVE-21611
>             Project: Hive
>          Issue Type: Bug
>            Reporter: bd2019us
>            Assignee: Hunter Logan
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: 1.patch
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> 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
(v8.3.4#803005)

Reply via email to