You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by se...@apache.org on 2016/11/20 17:41:23 UTC

aurora git commit: Speedup preemption by eliminating costly sting formatting.

Repository: aurora
Updated Branches:
  refs/heads/master 203da709d -> 91ec949bb


Speedup preemption by eliminating costly sting formatting.

Before:
SchedulingBenchmarks.PreemptorSlotSearchBenchmark.runBenchmark                  1  thrpt   10  16.011 � 0.323  ops/s
SchedulingBenchmarks.PreemptorSlotSearchBenchmark.runBenchmark                 10  thrpt   10  15.141 � 3.774  ops/s
SchedulingBenchmarks.PreemptorSlotSearchBenchmark.runBenchmark                100  thrpt   10  16.178 � 3.710  ops/s
SchedulingBenchmarks.PreemptorSlotSearchBenchmark.runBenchmark               1000  thrpt   10  16.358 � 0.540  ops/s

After:
SchedulingBenchmarks.PreemptorSlotSearchBenchmark.runBenchmark                  1  thrpt   10  41.832 � 1.412  ops/s
SchedulingBenchmarks.PreemptorSlotSearchBenchmark.runBenchmark                 10  thrpt   10  46.049 � 3.435  ops/s
SchedulingBenchmarks.PreemptorSlotSearchBenchmark.runBenchmark                100  thrpt   10  44.199 � 1.272  ops/s
SchedulingBenchmarks.PreemptorSlotSearchBenchmark.runBenchmark               1000  thrpt   10  38.722 � 0.773  ops/s

Reviewed at https://reviews.apache.org/r/53928/


Project: http://git-wip-us.apache.org/repos/asf/aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/91ec949b
Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/91ec949b
Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/91ec949b

Branch: refs/heads/master
Commit: 91ec949bb293ff8de2fde3dd66c527dda5749a4a
Parents: 203da70
Author: Stephan Erb <se...@apache.org>
Authored: Sun Nov 20 18:40:53 2016 +0100
Committer: Stephan Erb <se...@apache.org>
Committed: Sun Nov 20 18:40:53 2016 +0100

----------------------------------------------------------------------
 src/main/java/org/apache/aurora/scheduler/TierManager.java        | 3 +--
 .../org/apache/aurora/scheduler/preemptor/PreemptorMetrics.java   | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/91ec949b/src/main/java/org/apache/aurora/scheduler/TierManager.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/TierManager.java b/src/main/java/org/apache/aurora/scheduler/TierManager.java
index d808c4c..c6ad2b1 100644
--- a/src/main/java/org/apache/aurora/scheduler/TierManager.java
+++ b/src/main/java/org/apache/aurora/scheduler/TierManager.java
@@ -25,7 +25,6 @@ import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
 import org.codehaus.jackson.annotate.JsonCreator;
 import org.codehaus.jackson.annotate.JsonProperty;
 
-import static java.lang.String.format;
 import static java.util.Objects.requireNonNull;
 
 import static com.google.common.base.Preconditions.checkArgument;
@@ -101,7 +100,7 @@ public interface TierManager {
     public TierInfo getTier(ITaskConfig taskConfig) {
       checkArgument(
           !taskConfig.isSetTier() || tierConfig.tiers.containsKey(taskConfig.getTier()),
-          format("Invalid tier '%s' in TaskConfig.", taskConfig.getTier()));
+          "Invalid tier '%s' in TaskConfig.", taskConfig.getTier());
 
       return tierConfig.tiers.get(taskConfig.getTier());
     }

http://git-wip-us.apache.org/repos/asf/aurora/blob/91ec949b/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptorMetrics.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptorMetrics.java b/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptorMetrics.java
index 30bb814..67822ca 100644
--- a/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptorMetrics.java
+++ b/src/main/java/org/apache/aurora/scheduler/preemptor/PreemptorMetrics.java
@@ -97,7 +97,7 @@ public class PreemptorMetrics {
 
   @VisibleForTesting
   static String slotSearchStatName(boolean success, boolean production) {
-    return String.format("preemptor_slot_search_%s_for_%s", result(success), prod(production));
+    return "preemptor_slot_search_" + result(success) + "_for_" + prod(production);
   }
 
   @VisibleForTesting