You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/09/22 20:50:11 UTC
[GitHub] [pinot] richardstartin edited a comment on pull request #7468: Replace emptiness checks with `isEmpty()`
richardstartin edited a comment on pull request #7468:
URL: https://github.com/apache/pinot/pull/7468#issuecomment-925311763
Just in case the `String` change is contentious, this will definitely not cause a performance regression:
```java
@State(Scope.Benchmark)
public class StringEmptyBenchmark {
@Param({"", "not empty"})
String string;
@Benchmark
public boolean isEmpty() {
return string.isEmpty();
}
@Benchmark
public boolean equalsEmpty() {
return "".equals(string);
}
}
```
```
Benchmark (string) Mode Cnt Score Error Units
StringEmptyBenchmark.equalsEmpty avgt 5 3.720 ± 0.657 ns/op
StringEmptyBenchmark.equalsEmpty not empty avgt 5 2.671 ± 0.011 ns/op
StringEmptyBenchmark.isEmpty avgt 5 2.017 ± 0.016 ns/op
StringEmptyBenchmark.isEmpty not empty avgt 5 1.997 ± 0.009 ns/op
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org