Skip to content

Commit

Permalink
add benchmark for version without padding
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrrzysko committed Apr 28, 2024
1 parent 123c524 commit 820cf16
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/jmh/java/org/simdjson/SchemaBasedParseAndSelectBenchmark.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ public void setup() throws IOException {

@Benchmark
public int countUniqueUsersWithDefaultProfile_simdjson() {
Set<String> defaultUsers = new HashSet<>();
SimdJsonTwitter twitter = simdJsonParser.parse(buffer, buffer.length, SimdJsonTwitter.class);
for (SimdJsonStatus status : twitter.statuses()) {
SimdJsonUser user = status.user();
if (user.default_profile()) {
defaultUsers.add(user.screen_name());
}
}
return defaultUsers.size();
}

@Benchmark
public int countUniqueUsersWithDefaultProfile_simdjsonPadded() {
Set<String> defaultUsers = new HashSet<>();
SimdJsonTwitter twitter = simdJsonParser.parse(bufferPadded, buffer.length, SimdJsonTwitter.class);
for (SimdJsonStatus status : twitter.statuses()) {
Expand Down

0 comments on commit 820cf16

Please sign in to comment.