From reviews-return-50506-apmail-mesos-reviews-archive=mesos.apache.org@mesos.apache.org Sat Nov 19 14:44:10 2016 Return-Path: X-Original-To: apmail-mesos-reviews-archive@minotaur.apache.org Delivered-To: apmail-mesos-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5717319286 for ; Sat, 19 Nov 2016 14:44:10 +0000 (UTC) Received: (qmail 41996 invoked by uid 500); 19 Nov 2016 14:44:10 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 41966 invoked by uid 500); 19 Nov 2016 14:44:10 -0000 Mailing-List: contact reviews-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@mesos.apache.org Delivered-To: mailing list reviews@mesos.apache.org Received: (qmail 41946 invoked by uid 99); 19 Nov 2016 14:44:09 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Nov 2016 14:44:09 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 659D41C0424; Sat, 19 Nov 2016 14:44:08 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============0376630358711932750==" MIME-Version: 1.0 Subject: Review Request 53929: Improved performance for `getQuotaRoleAllocatedResources` in allocator. From: Guangya Liu To: Benjamin Mahler Cc: Guangya Liu , mesos Date: Sat, 19 Nov 2016 14:44:08 -0000 Message-ID: <20161119144408.20485.31576@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Guangya Liu X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/53929/ X-Sender: Guangya Liu Reply-To: Guangya Liu X-ReviewRequest-Repository: mesos --===============0376630358711932750== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/53929/ ----------------------------------------------------------- Review request for mesos and Benjamin Mahler. Repository: mesos Description ------- In allocator `getQuotaRoleAllocatedResources`, it is trying to omits dynamic reservation, persistent volume info and additionally strip `role` in it. But it is traversing all `Resource` object from the `Resources` object, strip the `role` and then using `+=` to add each `Resource` object back. The `+=` for `Resource` object will invoke `validate` which will impact the performance. This fix is calling `flatten()` directly to strip the `role` for the all of the `Resource` objects and this will not invoke `validate`. Diffs ----- src/master/allocator/mesos/hierarchical.cpp c8f9492ee1b69e125a1e841116d22a578a9b524e Diff: https://reviews.apache.org/r/53929/diff/ Testing ------- make make check ``` ./bin/mesos-tests.sh --gtest_filter="HierarchicalAllocatorTest.*" ./bin/mesos-tests.sh --gtest_filter="*HierarchicalAllocator_BENCHMARK_Test.*/0" --benchmark ``` Thanks, Guangya Liu --===============0376630358711932750==--