hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Templeton (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-7136) Additional Performance Improvement for Resource Profile Feature
Date Sun, 03 Sep 2017 03:21:03 GMT

    [ https://issues.apache.org/jira/browse/YARN-7136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16151658#comment-16151658

Daniel Templeton commented on YARN-7136:

Here's some first pass comments:

bq. If two objects are equal according to the equals(Object) method, then calling the hashCode
method on each of the two objects must produce the same integer result.

In {Resource.compareTo()}}, should the check {{if (arrLenThis < arrLenOther)}} come at
the beginning?

In {{toString()}}, would it be more efficient to always append the comma and delete the last
one at the end?

In {{hashCode()}}, per the discussion on YARN-6788, the number 939769357 is totally arbitrary,
and 263167 is probably a bit large of a prime.  You'll get overflows.  Same with {{BaseResource.hashCode()}}.

In {{ResourceInformation}} should the constants be called URIs?  Aren't they just names?

In {{DominantResourceCalculator.calculateSharesForTwoMandatoryResources()}}, is it really
worth adding the length to the signature? You're retrieving the value in all the other methods,
so why not there as well?

I still need to take a closer look.

> Additional Performance Improvement for Resource Profile Feature
> ---------------------------------------------------------------
>                 Key: YARN-7136
>                 URL: https://issues.apache.org/jira/browse/YARN-7136
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: nodemanager, resourcemanager
>            Reporter: Wangda Tan
>            Assignee: Wangda Tan
>            Priority: Critical
>         Attachments: YARN-7136.001.patch, YARN-7136.YARN-3926.001.patch, YARN-7136.YARN-3926.002.patch,
YARN-7136.YARN-3926.003.patch, YARN-7136.YARN-3926.004.patch, YARN-7136.YARN-3926.005.patch,
YARN-7136.YARN-3926.006.patch, YARN-7136.YARN-3926.007.patch
> This JIRA is plan to add following misc perf improvements:
> 1) Use final int in Resources/ResourceCalculator to cache #known-resource-types. (Significant
> 2) Catch Java's ArrayOutOfBound Exception instead of checking array.length every time.
(Significant improvement).
> 3) Avoid setUnit validation (which is a HashSet lookup) when initialize default Memory/VCores
ResourceInformation (Significant improvement).
> 4) Avoid unnecessary loop array in Resource#toString/hashCode. (Some improvement).
> 5) Removed readOnlyResources in BaseResource. (Minor improvement).
> 6) Removed enum: MandatoryResources, use final integer instead. (Minor improvement).

This message was sent by Atlassian JIRA

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

View raw message