flyrain commented on pull request #3530:
URL: https://github.com/apache/iceberg/pull/3530#issuecomment-965811901
Hi @RussellSpitzer, change the test code to use the comparison result. Got
similar perf gain.
```
private void perfCompare(CharSequence str1, CharSequence str2) {
int count = 1_000_000;
boolean result = true;
long start = System.nanoTime();
for(int i = 0; i < count; i++) {
result = equals(str1, str2);
}
long stop = System.nanoTime();
long duration1 = stop-start;
System.out.println("Time: " + (stop-start)/1000000.0 + " msec, result: "
+ result);
Comparator<CharSequence> charSequenceComparator =
Comparators.charSequences();
start = System.nanoTime();
for(int i = 0; i < count; i++) {
result = charSequenceComparator.compare(str1, str2) == 0;
}
stop = System.nanoTime();
System.out.println("Time: " + (stop-start)/1000000.0 + " msec, result: "
+ result);
System.out.println("Duration compare: " + (double)(stop-start)/duration1
+ " times");
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]