Hi,

after doing some profiling and analysis I have found that rhino is doing a
lot of class loading which often fails. This is coming from
NativeJavaPackage.java / getPkgProperty (a lot of ClassNotFoundException
exceptions are thrown and catched there). This stems from references in a
flow script to Java classes, ...

Although there is a cache this does not prevent a lot of class loading
(failing most of the time) for each new request (until the cache is filled
anew). The originating call is in ContinuationInterpreter
(ScriptRuntime.getProp).

I am not sure how a real fix of this problem would look like. Nevertheless,
I have made a naive fix for the problem (patch attached) that simply adds a
cache to NativeJavaPackage. This resolved the issue for my test scenario and
resulted in a great performance increase.

When looking at the initial code I think there could be a more elegant
solution (that does not need a "secondary" cache). Furthermore, I am not
sure if my "quick fix" has side effects or not (e.g. when a huge number of
classes is referenced of one and the same package).

Has anybody else already encountered this issue and found a different
solution? What do you think of my solution? Any other ideas / comments?

Regards,
  Georg

-- 
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner

Attachment: NativeJavaPackage.java.diff
Description: Binary data

Reply via email to