-
Enhancement
-
Resolution: Fixed
-
P4
-
8, 9, 10
-
b11
-
generic
-
generic
FULL PRODUCT VERSION :
A DESCRIPTION OF THE PROBLEM :
Every time the method getScriptContext is called, a new instance of SimpleScriptContext is created. This calls
reader = new InputStreamReader(System.in);
writer = new PrintWriter(System.out , true);
errorWriter = new PrintWriter(System.err, true);
immediately to be replaced by
ctxt.setReader(context.getReader());
ctxt.setWriter(context.getWriter());
ctxt.setErrorWriter(context.getErrorWriter());
The creation of the reader and writers causes significant overhead in the sense that these objects need to be immediately garbage collected again.
When this method is called a lot, a new Constructor for SimpleScriptContext that allows the passing of the reader and writers would be a lot more efficient.
REPRODUCIBILITY :
This bug can be reproduced always.
A DESCRIPTION OF THE PROBLEM :
Every time the method getScriptContext is called, a new instance of SimpleScriptContext is created. This calls
reader = new InputStreamReader(System.in);
writer = new PrintWriter(System.out , true);
errorWriter = new PrintWriter(System.err, true);
immediately to be replaced by
ctxt.setReader(context.getReader());
ctxt.setWriter(context.getWriter());
ctxt.setErrorWriter(context.getErrorWriter());
The creation of the reader and writers causes significant overhead in the sense that these objects need to be immediately garbage collected again.
When this method is called a lot, a new Constructor for SimpleScriptContext that allows the passing of the reader and writers would be a lot more efficient.
REPRODUCIBILITY :
This bug can be reproduced always.