Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 754B7200C1E for ; Fri, 17 Feb 2017 17:18:46 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 73FAA160B55; Fri, 17 Feb 2017 16:18:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BF65D160B3F for ; Fri, 17 Feb 2017 17:18:45 +0100 (CET) Received: (qmail 38930 invoked by uid 500); 17 Feb 2017 16:18:45 -0000 Mailing-List: contact issues-help@aurora.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aurora.apache.org Delivered-To: mailing list issues@aurora.apache.org Received: (qmail 38919 invoked by uid 99); 17 Feb 2017 16:18:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Feb 2017 16:18:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 2BCA4C132E for ; Fri, 17 Feb 2017 16:18:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.199 X-Spam-Level: X-Spam-Status: No, score=-1.199 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id D1PM5tI0hXqd for ; Fri, 17 Feb 2017 16:18:43 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 3487A5F613 for ; Fri, 17 Feb 2017 16:18:43 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id EFDDDE0223 for ; Fri, 17 Feb 2017 16:18:41 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id AE4AE2411B for ; Fri, 17 Feb 2017 16:18:41 +0000 (UTC) Date: Fri, 17 Feb 2017 16:18:41 +0000 (UTC) From: "Mehrdad Nurolahzade (JIRA)" To: issues@aurora.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AURORA-1894) Inline preemption filter in PreemptionVictimFilterImpl MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 17 Feb 2017 16:18:46 -0000 [ https://issues.apache.org/jira/browse/AURORA-1894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15872045#comment-15872045 ] Mehrdad Nurolahzade commented on AURORA-1894: --------------------------------------------- I used YourKit (default settings), can't say if this caused by profiler bytecode manipulations for sampling or not. However, just by looking at this logic, I am not sure if compiler can do such optimizations. The Lambda is dependent on the method parameter ({{ITaskConfig pendingTask}}). {code} private Predicate preemptionFilter(final ITaskConfig pendingTask) { return possibleVictim -> { boolean pendingIsPreemptible = tierManager.getTier(pendingTask).isPreemptible(); boolean victimIsPreemptible = tierManager.getTier(possibleVictim.getConfig()).isPreemptible(); if (!pendingIsPreemptible && victimIsPreemptible) { return true; } else if (pendingIsPreemptible == victimIsPreemptible) { // If preemptible flags are equal, preemption is based on priority within the same role. if (pendingTask.getJob().getRole().equals(possibleVictim.getRole())) { return pendingTask.getPriority() > possibleVictim.getPriority(); } else { return false; } } else { return false; } }; } {code} > Inline preemption filter in PreemptionVictimFilterImpl > ------------------------------------------------------ > > Key: AURORA-1894 > URL: https://issues.apache.org/jira/browse/AURORA-1894 > Project: Aurora > Issue Type: Task > Components: Scheduler > Reporter: Mehrdad Nurolahzade > Priority: Minor > Labels: newbie > > Profiling preemption logic, I can see {{PreemptionVictimFilterImpl#preemptionFilter()}} is producing ~200K/sec lambda objects to be used by {{filterPreemptionVictims()}}: > {code:title=PreemptionVictimFilterImpl.filterPreemptionVictims()} > FluentIterable preemptableTasks = FluentIterable.from(possibleVictims) > .filter(preemptionFilter(pendingTask)); > {code} > Inline this logic (refactor to loop) to remove the need to create these short-lived lambda objects. -- This message was sent by Atlassian JIRA (v6.3.15#6346)