hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "hu xiaodong (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Deleted] (HADOOP-14513) A little performance improvement of HarFileSystem
Date Mon, 12 Jun 2017 03:43:02 GMT

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

hu xiaodong updated HADOOP-14513:
---------------------------------
    Comment: was deleted

(was: Hi [~raviprak]!
     sorry ,I have no benchmarks / profiles. And I don't know  if the JVM  already optimize
it.  
     If the JVM has already optimize it. I will close the issue.
Thanks.)

> A little performance improvement of HarFileSystem
> -------------------------------------------------
>
>                 Key: HADOOP-14513
>                 URL: https://issues.apache.org/jira/browse/HADOOP-14513
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 3.0.0-alpha3
>            Reporter: hu xiaodong
>            Assignee: hu xiaodong
>            Priority: Trivial
>         Attachments: HADOOP-14513.001.patch
>
>
> In the Java source of HarFileSystem.java:
> {code:title=HarFileSystem.java|borderStyle=solid}
> ...................
> ...................
> private Path archivePath(Path p) {
>     Path retPath = null;
>     Path tmp = p;
>     
>     // I think p.depth() need not be loop many times, depth() is a complex calculation
>     for (int i=0; i< p.depth(); i++) {
>       if (tmp.toString().endsWith(".har")) {
>         retPath = tmp;
>         break;
>       }
>       tmp = tmp.getParent();
>     }
>     return retPath;
>   }
> ...................
> ...................
> {code}
>  
> I think the fellow is more suitable:
> {code:title=HarFileSystem.java|borderStyle=solid}
> ...................
> ...................
> private Path archivePath(Path p) {
>     Path retPath = null;
>     Path tmp = p;
>     
>     // just loop once
>     for (int i=0,depth=p.depth(); i< depth; i++) {
>       if (tmp.toString().endsWith(".har")) {
>         retPath = tmp;
>         break;
>       }
>       tmp = tmp.getParent();
>     }
>     return retPath;
>   }
> ...................
> ...................
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message