From reviews-return-86675-apmail-mesos-reviews-archive=mesos.apache.org@mesos.apache.org Thu Mar 28 02:10:55 2019 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 3F88A18B53 for ; Thu, 28 Mar 2019 02:10:55 +0000 (UTC) Received: (qmail 18746 invoked by uid 500); 28 Mar 2019 02:10:55 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 18703 invoked by uid 500); 28 Mar 2019 02:10:55 -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 18687 invoked by uid 99); 28 Mar 2019 02:10:54 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Mar 2019 02:10:54 +0000 Received: from reviews.apache.org (unknown [10.41.0.12]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id F2960E0111; Thu, 28 Mar 2019 02:10:53 +0000 (UTC) Received: from reviews-vm2.apache.org (localhost [IPv6:::1]) by reviews.apache.org (ASF Mail Server at reviews-vm2.apache.org) with ESMTP id E13CBC4021F; Thu, 28 Mar 2019 02:10:53 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============5034419755001995948==" MIME-Version: 1.0 Subject: Review Request 70330: Used `ResourceQuantities` in the sorter when appropriate. From: Meng Zhu To: Benjamin Mahler Cc: Meng Zhu , mesos Date: Thu, 28 Mar 2019 02:10:53 -0000 Message-ID: <20190328021053.24117.77395@reviews-vm2.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Meng Zhu X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/70330/ X-Sender: Meng Zhu Reply-To: Meng Zhu X-ReviewRequest-Repository: mesos --===============5034419755001995948== 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/70330/ ----------------------------------------------------------- Review request for mesos and Benjamin Mahler. Bugs: MESOS-9504 https://issues.apache.org/jira/browse/MESOS-9504 Repository: mesos Description ------- Replaced `Resources` with `ResourceQuantities` when appropriate in the sorter. This simplifies the code and improves performance. Diffs ----- src/master/allocator/mesos/hierarchical.cpp 8bc749903b8ceb09a02e260919377483479302b5 src/master/allocator/sorter/drf/sorter.hpp 75f90f331fbe2ec514daa3fe00b0b05ad55932e1 src/master/allocator/sorter/drf/sorter.cpp 43c97671d692675df6a347e4482126d83d7e3f24 src/master/allocator/sorter/random/sorter.hpp 2031cb234cc3e29723f07ec7d3a7e8671a26a97f src/master/allocator/sorter/random/sorter.cpp 6fcfc41f65bb6401cfb60af88866c2b02920887e src/master/allocator/sorter/sorter.hpp 25ad48dff7e624e7d25072958bdd20513ab83d12 src/tests/sorter_tests.cpp 1e2791f993af2fba592b0e76493864c096a0bb5f Diff: https://reviews.apache.org/r/70330/diff/1/ Testing ------- make check # Benchmark Result Optimized build on a 2.2GHz/64GB box Each ran three times for average **TL;DR: ~20% speedup for nonquota benchmark; ~30% speedup for quota benchmark** ## Non-quota allocation Ran `BENCHMARK_HierarchicalAllocator_WithNonQuotaVsQuotaParam.NonQuotaVsQuota` Selected the Nonquota result Before: - 20 agents, 10 roles, 20 frameworks Made 20 allocations in 2.382283667ms - 200 agents, 100 roles, 200 frameworks Made 200 allocations in 19.05821233ms - 2000 agents, 1000 roles, 2000 frameworks Made 2000 allocations in 792.1674363ms After: - 20 agents, 10 roles, 20 frameworks Made 20 allocations in 2.329543667ms // 2% speedup - 200 agents, 100 roles, 200 frameworks Made 200 allocations in 15.40222667ms // 19% speedup - 2000 agents, 1000 roles, 2000 frameworks Made 2000 allocations in 644.5257763ms // 19% speedup ## Quota Allocation Ran `BENCHMARK_HierarchicalAllocator_WithQuotaParam.LargeAndSmallQuota` Before: - 30 agents, 30 roles, 30 frameworks Made 36 allocations in 9.656610667ms - 300 agents, 300 roles, 300 frameworks Made 350 allocations in 292.0376493ms - 3000 agents, 3000 roles, 3000 frameworks Made 3500 allocations in 22.74423621secs After: - 30 agents, 30 roles, 30 frameworks Made 36 allocations in 6.742066667ms // 30% speedup - 300 agents, 300 roles, 300 frameworks Made 350 allocations in 187.105902ms // 35% speedup - 3000 agents, 3000 roles, 3000 frameworks Made 3500 allocations in 14.74580913secs // 36% speedup Thanks, Meng Zhu --===============5034419755001995948==--