[
https://issues.apache.org/jira/browse/MESOS-5921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15398446#comment-15398446
]
Guangya Liu commented on MESOS-5921:
------------------------------------
Sure Ben, I will use {{callgrind}} to check why the performance was not
improved much before post the patch. As here I was using `Ports` resources, the
performance here should have some improvement after using {{isNegative}}
ideally.
> `validate` is a bit heavy to check negative scalar resource
> -----------------------------------------------------------
>
> Key: MESOS-5921
> URL: https://issues.apache.org/jira/browse/MESOS-5921
> Project: Mesos
> Issue Type: Bug
> Reporter: Guangya Liu
> Assignee: Guangya Liu
>
> When subtract resources finished, we need to call {{Resources::validate}} to
> check if the scalar resource is negative so as to remove this resource if it
> is negative. This is a bit heavy as the {{Resources::validate}} did many
> validation stuffs, such as checking type, validating role, checking resource
> name etc, all of them are not necessary.
> We should introduce a new helper function {{isNegative}} to check if the
> resource is a negative scalar resource.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)