-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into amains/build/upgrade_gradle
- Loading branch information
Showing
20 changed files
with
648 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,35 @@ | ||
Benchmark Mode Cnt Score Error Units | ||
ScopeImplBenchmark.scopeReportingBenchmark thrpt 10 1385.711 ± 55.291 ops/ms | ||
ScopeImplBenchmark.scopeReportingBenchmark:·async thrpt NaN --- | ||
ScopeImplBenchmark.scopeReportingBenchmark:·gc.alloc.rate thrpt 10 ≈ 10⁻⁴ MB/sec | ||
ScopeImplBenchmark.scopeReportingBenchmark:·gc.alloc.rate.norm thrpt 10 ≈ 10⁻⁴ B/op | ||
ScopeImplBenchmark.scopeReportingBenchmark:·gc.count thrpt 10 ≈ 0 counts | ||
ScopeImplBenchmark.scopeReportingBenchmark:·threads.alive thrpt 10 5.800 ± 0.637 threads | ||
ScopeImplBenchmark.scopeReportingBenchmark:·threads.daemon thrpt 10 4.000 ± 0.001 threads | ||
ScopeImplBenchmark.scopeReportingBenchmark:·threads.started thrpt 10 26.000 threads | ||
Benchmark Mode Cnt Score Error Units | ||
ScopeImplBenchmark.scopeReportingBenchmark thrpt 10 1345.606 ± 129.913 ops/ms | ||
ScopeImplBenchmark.scopeReportingBenchmark:·async thrpt NaN --- | ||
ScopeImplBenchmark.scopeReportingBenchmark:·gc.alloc.rate thrpt 10 ≈ 10⁻⁴ MB/sec | ||
ScopeImplBenchmark.scopeReportingBenchmark:·gc.alloc.rate.norm thrpt 10 ≈ 10⁻⁴ B/op | ||
ScopeImplBenchmark.scopeReportingBenchmark:·gc.count thrpt 10 ≈ 0 counts | ||
ScopeImplBenchmark.scopeReportingBenchmark:·threads.alive thrpt 10 5.800 ± 0.637 threads | ||
ScopeImplBenchmark.scopeReportingBenchmark:·threads.daemon thrpt 10 4.000 ± 0.001 threads | ||
ScopeImplBenchmark.scopeReportingBenchmark:·threads.started thrpt 10 26.000 threads | ||
ScopeImplBenchmark.scopeTaggedBenchmark thrpt 10 2440.881 ± 73.028 ops/ms | ||
ScopeImplBenchmark.scopeTaggedBenchmark:·async thrpt NaN --- | ||
ScopeImplBenchmark.scopeTaggedBenchmark:·gc.alloc.rate thrpt 10 1947.506 ± 58.647 MB/sec | ||
ScopeImplBenchmark.scopeTaggedBenchmark:·gc.alloc.rate.norm thrpt 10 880.000 ± 0.001 B/op | ||
ScopeImplBenchmark.scopeTaggedBenchmark:·gc.churn.G1_Eden_Space thrpt 10 1940.575 ± 57.874 MB/sec | ||
ScopeImplBenchmark.scopeTaggedBenchmark:·gc.churn.G1_Eden_Space.norm thrpt 10 876.878 ± 5.246 B/op | ||
ScopeImplBenchmark.scopeTaggedBenchmark:·gc.churn.G1_Old_Gen thrpt 10 0.168 ± 0.001 MB/sec | ||
ScopeImplBenchmark.scopeTaggedBenchmark:·gc.churn.G1_Old_Gen.norm thrpt 10 0.076 ± 0.002 B/op | ||
ScopeImplBenchmark.scopeTaggedBenchmark:·gc.count thrpt 10 1736.000 counts | ||
ScopeImplBenchmark.scopeTaggedBenchmark:·gc.time thrpt 10 1772.000 ms | ||
ScopeImplBenchmark.scopeTaggedBenchmark:·threads.alive thrpt 10 5.800 ± 0.637 threads | ||
ScopeImplBenchmark.scopeTaggedBenchmark:·threads.daemon thrpt 10 4.000 ± 0.001 threads | ||
ScopeImplBenchmark.scopeTaggedBenchmark:·threads.started thrpt 10 26.000 threads | ||
ScopeImplConcurrent.hotkeyLockContention thrpt 10 1.430 ± 0.218 ops/ms | ||
ScopeImplConcurrent.hotkeyLockContention:·async thrpt NaN --- | ||
ScopeImplConcurrent.hotkeyLockContention:·gc.alloc.rate thrpt 10 1244.444 ± 187.772 MB/sec | ||
ScopeImplConcurrent.hotkeyLockContention:·gc.alloc.rate.norm thrpt 10 960144.037 ± 0.011 B/op | ||
ScopeImplConcurrent.hotkeyLockContention:·gc.churn.G1_Eden_Space thrpt 10 1237.763 ± 186.894 MB/sec | ||
ScopeImplConcurrent.hotkeyLockContention:·gc.churn.G1_Eden_Space.norm thrpt 10 954972.637 ± 4468.064 B/op | ||
ScopeImplConcurrent.hotkeyLockContention:·gc.churn.G1_Old_Gen thrpt 10 0.166 ± 0.001 MB/sec | ||
ScopeImplConcurrent.hotkeyLockContention:·gc.churn.G1_Old_Gen.norm thrpt 10 129.528 ± 18.631 B/op | ||
ScopeImplConcurrent.hotkeyLockContention:·gc.count thrpt 10 1564.000 counts | ||
ScopeImplConcurrent.hotkeyLockContention:·gc.time thrpt 10 1336.000 ms | ||
ScopeImplConcurrent.hotkeyLockContention:·threads.alive thrpt 10 5.800 ± 0.637 threads | ||
ScopeImplConcurrent.hotkeyLockContention:·threads.daemon thrpt 10 4.000 ± 0.001 threads | ||
ScopeImplConcurrent.hotkeyLockContention:·threads.started thrpt 10 26.000 threads |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#bprof=async:event=cpu;direction=forward;output=flamegraph;dir=profile-results;libPath=<path-to-libasyncProfiler.so> | ||
#benchclass=ScopeImplBenchmark.* | ||
#output=benchmark-new.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
core/src/jmh/java/com/uber/m3/tally/ScopeImplConcurrent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Copyright (c) 2023 Uber Technologies, Inc. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
package com.uber.m3.tally; | ||
|
||
import com.uber.m3.util.Duration; | ||
import com.uber.m3.util.ImmutableMap; | ||
import org.openjdk.jmh.annotations.*; | ||
import org.openjdk.jmh.infra.Blackhole; | ||
|
||
import java.util.List; | ||
import java.util.concurrent.TimeUnit; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.Stream; | ||
|
||
@BenchmarkMode(Mode.Throughput) | ||
@OutputTimeUnit(TimeUnit.MILLISECONDS) | ||
@Fork(value = 2, jvmArgsAppend = { "-server", "-XX:+UseG1GC" }) | ||
public class ScopeImplConcurrent { | ||
private static final List<ScopeKey> SCOPE_KEYS = | ||
Stream.of(" ", "0", "@", "P").map(prefix -> new ScopeKey(prefix, null)).collect(Collectors.toList()); | ||
|
||
@Benchmark | ||
public void hotkeyLockContention(Blackhole bh, BenchmarkState state) { | ||
ImmutableMap<String, String> common = new ImmutableMap.Builder<String, String>().build(); | ||
for (int i = 0; i < 10000; i++) { | ||
|
||
for (ScopeKey scopeKey : SCOPE_KEYS) { | ||
Scope scope = state.scope.computeSubscopeIfAbsent("prefix", scopeKey, common); | ||
assert scope != null; | ||
bh.consume(scope); | ||
} | ||
} | ||
} | ||
|
||
@State(org.openjdk.jmh.annotations.Scope.Benchmark) | ||
public static class BenchmarkState { | ||
|
||
private ScopeImpl scope; | ||
|
||
@Setup | ||
public void setup() { | ||
this.scope = | ||
(ScopeImpl) new RootScopeBuilder() | ||
.reporter(new TestStatsReporter()) | ||
.reportEvery(Duration.MAX_VALUE); | ||
|
||
for (ScopeKey scopeKey : SCOPE_KEYS) { | ||
scope.computeSubscopeIfAbsent("prefix", scopeKey, new ImmutableMap.Builder<String, String>().build()); | ||
} | ||
} | ||
|
||
@TearDown | ||
public void teardown() { | ||
scope.close(); | ||
} | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
core/src/main/java/com/uber/m3/tally/NullStatsReporter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Copyright (c) 2023 Uber Technologies, Inc. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
package com.uber.m3.tally; | ||
|
||
import com.uber.m3.util.Duration; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* NullStatsReporter is a noop implementation of StatsReporter. | ||
*/ | ||
public class NullStatsReporter implements StatsReporter { | ||
@Override | ||
public Capabilities capabilities() { | ||
return CapableOf.NONE; | ||
} | ||
|
||
@Override | ||
public void flush() { | ||
|
||
} | ||
|
||
@Override | ||
public void close() { | ||
|
||
} | ||
|
||
@Override | ||
public void reportCounter(String name, Map<String, String> tags, long value) { | ||
|
||
} | ||
|
||
@Override | ||
public void reportGauge(String name, Map<String, String> tags, double value) { | ||
|
||
} | ||
|
||
@Override | ||
public void reportTimer(String name, Map<String, String> tags, Duration interval) { | ||
|
||
} | ||
|
||
@Override | ||
public void reportHistogramValueSamples(String name, Map<String, String> tags, Buckets buckets, double bucketLowerBound, double bucketUpperBound, long samples) { | ||
|
||
} | ||
|
||
@Override | ||
public void reportHistogramDurationSamples(String name, Map<String, String> tags, Buckets buckets, Duration bucketLowerBound, Duration bucketUpperBound, long samples) { | ||
|
||
} | ||
} |
Oops, something went wrong.