This is an automated email from the ASF dual-hosted git repository. laurent pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/calcite.git
commit 022016611091fdc021686aaf1a44f5217b4b3d30 Author: Laurent Goujon <[email protected]> AuthorDate: Thu Apr 30 17:43:36 2020 -0700 [CALCITE-3965] Avoid DiffRepository lock contention When many test cases using the same DiffRepository instances are running on multiple threads, it causes lots of contention because all methods are synchronized. One of the most used method is DiffRepository#expand(String, String) which do not alter the state of the tree in most cases. As the method content itself is thread-safe, remove the synchronized keyword as it does not bring any extra safety and just increase artificially the contention around the lock. --- core/src/test/java/org/apache/calcite/test/DiffRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/test/java/org/apache/calcite/test/DiffRepository.java b/core/src/test/java/org/apache/calcite/test/DiffRepository.java index 36593df..875e2dc 100644 --- a/core/src/test/java/org/apache/calcite/test/DiffRepository.java +++ b/core/src/test/java/org/apache/calcite/test/DiffRepository.java @@ -235,7 +235,7 @@ public class DiffRepository { * Expands a string containing one or more variables. (Currently only works * if there is one variable.) */ - public synchronized String expand(String tag, String text) { + public String expand(String tag, String text) { if (text == null) { return null; } else if (text.startsWith("${")
