• Bug
  • Status: Open
  • 2 Major
  • Resolution:
  • DSO:L1
  • interfaces
  • Reporter: amiller
  • September 22, 2008
  • 0
  • Watchers: 0
  • December 16, 2011


Right now, when we use an onload method, that method call is pushed into a bsh script and executed in the identical way to the beanshell script is executed. This causes onload methods to incur Beanshell parsing, evaluation, and reflective invocation of the method.

It would be better to use reflection directly to invoke the method or even better add an interface like OnloadAware and generate the implementation to call the actual onload method directly. This would probably give us substantial speedup for onload method calls.


Geert Bevin 2008-09-22

I don’t know the details of Beanshell, but other scripting languages that I’ve used like Janino (which is even closer to Java than Beanshell), allow the parsing and compilation into directly executable script instances. Once those are created, the execution is very fast!

Alex Miller 2008-09-22

In this case, there’s no reason to do any scripting at all. Even in the case of compilation (which I don’t think is happening here), it would at best be the same as using reflection (which beanshell is using for the invoke) and not as good as direct invocation. You’d still have to parse and compile as well which has some cost.

Fiona OShea 2008-09-22

If this is an issue for anyone then we should do it sooner and pull out of the pending bucket.