[m-rev.] for review: Commit java as Error should not fill in stack trace
Maxime Van Assche
mvanassche at odaseontologies.com
Sat Nov 4 01:49:15 AEDT 2017
As far as I can tell, using Throwable for Commit does not require the stack trace.
However, the default constructor of Error constructs the stack trace, which is costly.
java/runtime/Commit.java :
Override fillInStackTrace to do nothing
diff --git a/java/runtime/Commit.java b/java/runtime/Commit.java
index a5f875ba..8cd0b68 100644
--- a/java/runtime/Commit.java
+++ b/java/runtime/Commit.java
@@ -9,6 +9,10 @@
package jmercury.runtime;
public class Commit extends java.lang.Error {
+ public Throwable fillInStackTrace() {
+ // do nothing, for performance reasons.
+ return this;
+ }
}
More information about the reviews
mailing list