-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mattalp/handcrafted-smap-parser' of github.com:DataDog/…
…dd-trace-java into mattalp/handcrafted-smap-parser
- Loading branch information
Showing
954 changed files
with
14,385 additions
and
4,491 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
15 changes: 15 additions & 0 deletions
15
.github/workflows/tests/check-pull-requests/payload-pull-request-instrumentation.json
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,15 @@ | ||
{ | ||
"pull_request": { | ||
"number": 7884, | ||
"draft": false, | ||
"labels": [ | ||
{ | ||
"name": "inst: java" | ||
}, | ||
{ | ||
"name": "type: bug" | ||
} | ||
], | ||
"title": "Adding some new features" | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
.github/workflows/tests/check-pull-requests/test-pull-request.sh
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
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
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,9 @@ | ||
plugins { | ||
id("me.champeau.jmh") | ||
} | ||
|
||
apply(from = "$rootDir/gradle/java.gradle") | ||
|
||
jmh { | ||
version = "1.28" | ||
} |
106 changes: 106 additions & 0 deletions
106
components/json/src/jmh/java/datadog/json/JsonWriterBenchmark.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,106 @@ | ||
package datadog.json; | ||
|
||
import static java.util.concurrent.TimeUnit.MICROSECONDS; | ||
import static org.openjdk.jmh.annotations.Mode.AverageTime; | ||
|
||
import org.openjdk.jmh.annotations.Benchmark; | ||
import org.openjdk.jmh.annotations.BenchmarkMode; | ||
import org.openjdk.jmh.annotations.Fork; | ||
import org.openjdk.jmh.annotations.OutputTimeUnit; | ||
import org.openjdk.jmh.infra.Blackhole; | ||
|
||
@BenchmarkMode(AverageTime) | ||
@OutputTimeUnit(MICROSECONDS) | ||
@Fork(value = 1) | ||
@SuppressWarnings("unused") | ||
public class JsonWriterBenchmark { | ||
@Benchmark | ||
public void writeSimpleArray(Blackhole blackhole) { | ||
try (JsonWriter writer = new JsonWriter()) { | ||
writer | ||
.beginArray() | ||
.beginObject() | ||
.name("true") | ||
.value(true) | ||
.endObject() | ||
.beginObject() | ||
.name("false") | ||
.value(false) | ||
.endObject() | ||
.endArray(); | ||
blackhole.consume(writer.toString()); | ||
} | ||
} | ||
|
||
@Benchmark | ||
public void writeComplexArray(Blackhole blackhole) { | ||
try (JsonWriter writer = new JsonWriter()) { | ||
writer | ||
.beginArray() | ||
.value("first level") | ||
.beginArray() | ||
.value("second level") | ||
.beginArray() | ||
.value("third level") | ||
.beginObject() | ||
.name("key") | ||
.value("value") | ||
.endObject() | ||
.beginObject() | ||
.name("key") | ||
.value("value") | ||
.endObject() | ||
.endArray() // second level | ||
.beginObject() | ||
.name("key") | ||
.value("value") | ||
.endObject() | ||
.endArray() // first level | ||
.beginObject() | ||
.name("key") | ||
.value("value") | ||
.endObject() | ||
.value("last value") | ||
.endArray(); | ||
blackhole.consume(writer.toString()); | ||
} | ||
} | ||
|
||
@Benchmark | ||
public void writeComplexObject(Blackhole blackhole) { | ||
try (JsonWriter writer = new JsonWriter()) { | ||
writer | ||
.beginObject() | ||
.name("attrs") | ||
.beginObject() | ||
.name("attr1") | ||
.value("value1") | ||
.name("attr2") | ||
.value("value2") | ||
.endObject() | ||
.name("data") | ||
.beginArray() | ||
.beginObject() | ||
.name("x") | ||
.value(1) | ||
.name("y") | ||
.value(12.3) | ||
.endObject() | ||
.beginObject() | ||
.name("x") | ||
.value(2) | ||
.name("y") | ||
.value(4.56) | ||
.endObject() | ||
.beginObject() | ||
.name("x") | ||
.value(3) | ||
.name("y") | ||
.value(789) | ||
.endObject() | ||
.endArray() | ||
.endObject(); | ||
blackhole.consume(writer.toString()); | ||
} | ||
} | ||
} |
Oops, something went wrong.