Return-Path: Delivered-To: apmail-excalibur-dev-archive@www.apache.org Received: (qmail 42957 invoked from network); 25 Jun 2004 13:32:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 25 Jun 2004 13:32:40 -0000 Received: (qmail 53769 invoked by uid 500); 25 Jun 2004 13:32:27 -0000 Delivered-To: apmail-excalibur-dev-archive@excalibur.apache.org Received: (qmail 53653 invoked by uid 500); 25 Jun 2004 13:32:25 -0000 Mailing-List: contact dev-help@excalibur.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: List-Id: "Excalibur Developers List" Reply-To: "Excalibur Developers List" Delivered-To: mailing list dev@excalibur.apache.org Received: (qmail 53052 invoked by uid 99); 25 Jun 2004 13:32:20 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [217.160.230.41] (HELO mout.perfora.net) (217.160.230.41) by apache.org (qpsmtpd/0.27.1) with ESMTP; Fri, 25 Jun 2004 06:32:20 -0700 Received: from %C (helo=[192.168.0.203]) by mrelay.perfora.net with ESMTP (Nemesis), id 1BdqoN-2WEX-0MKz5u-00062P; Fri, 25 Jun 2004 09:32:11 -0400 Message-ID: <40DC2959.2030003@d-haven.org> Date: Fri, 25 Jun 2004 09:32:09 -0400 From: Berin Loritsch Organization: D-Haven.org User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Excalibur Developers List Subject: Re: [RT] About proxies and pooling References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Carsten Ziegeler wrote: > Berin Loritsch wrote: > >>>Hmm, just curious. If we would create BCEL proxies wouldn't >>>the performance problem go away? >> >>There is BCEL proxy generating code in there already (still some >>minor issues, but decent enough). >> >>The BCEL code was significantly faster than reflection based >>dynamic proxies, but there is still a considerable overhead to >>BCEL proxies. I can't remember if the price was 5 to 1 or 3 to 1 >>for the BCEL proxies. >> > > Ok, I have not looked at the BCEL code yet, but my thought was that it > works this way: > Imagine you have an interface A with one method do(), you create > a proxy that implements interface A as well, holds a reference to > the wrapped component and calls inside its own do() method, > simply the do() method of the wrapped object. > Is it this way? If so, I wouldn't understand the performance problem :) This is the rough equivalent of what BCEL generates: class BCELGeneratedProxy implements A { private final A m_proxy; public BCELGeneratedProxy(A proxy) { m_proxy = proxy; } public void do() { m_proxy.do(); } } Do keep in mind that there is a heavy penalty for creating classes with BCEL due to the class compilation time. There is still a penalty involved with the wrapper class. I'm not sure if it is because hotspot is not recompiling or inlining it or if there is some other technical issue I am not aware of. I will say that BCEL programming is a royal pain. While I believe this is what is happening, there could be some gotchas that I am not aware of that sap the performance. -- "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@excalibur.apache.org For additional commands, e-mail: dev-help@excalibur.apache.org Apache Excalibur Project -- URL: http://excalibur.apache.org/