From 0677032a0a698c920f02b44fcf7528fc3a6ce448 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Fri, 12 Feb 2021 14:18:37 +0100 Subject: Skip instrumentation for known no-throw methods A method invocation only needs to be instrumented for coverage if the method can throw an exception (including RuntimeException, which is not declared via `throws`). For methods in the Java standard library (in `java.*`), this property is thoroughly documented via Javadoc. This commit adds a doclet, i.e., a Java program that parses Javadoc, for automatically compiling a list of known no-throw methods in `java.*`. The list is loaded lazily at runtime and used to skip calls to these methods in the coverage instrumentation. With OpenJDK 15, the list consists of almost 9000 methods, many of which are used very frequently and in performance-critical parts, e.g., StringBuilder#append(String) and List#size(). --- .bazelrc | 1 + 1 file changed, 1 insertion(+) (limited to '.bazelrc') diff --git a/.bazelrc b/.bazelrc index f928b4b6..edc80742 100644 --- a/.bazelrc +++ b/.bazelrc @@ -7,6 +7,7 @@ build --action_env=CC=clang # Java build --java_language_version=8 +build --tool_java_language_version=9 # Maven publishing build:maven --stamp -- cgit v1.2.3