Return-Path: Delivered-To: apmail-incubator-geronimo-dev-archive@www.apache.org Received: (qmail 77706 invoked from network); 6 Sep 2003 06:26:55 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 6 Sep 2003 06:26:55 -0000 Received: (qmail 54263 invoked by uid 500); 6 Sep 2003 06:26:18 -0000 Delivered-To: apmail-incubator-geronimo-dev-archive@incubator.apache.org Received: (qmail 54169 invoked by uid 500); 6 Sep 2003 06:26:16 -0000 Mailing-List: contact geronimo-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: geronimo-dev@incubator.apache.org Delivered-To: mailing list geronimo-dev@incubator.apache.org Received: (qmail 54147 invoked from network); 6 Sep 2003 06:26:16 -0000 Received: from unknown (HELO public.coredevelopers.net) (209.233.18.245) by daedalus.apache.org with SMTP; 6 Sep 2003 06:26:16 -0000 Received: from coredevelopers.net (dsundstrom-host236.dsl.visi.com [208.42.65.236]) (using TLSv1 with cipher DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by public.coredevelopers.net (Postfix on SuSE Linux 8.0 (i386)) with ESMTP id D6C611CA00 for ; Fri, 5 Sep 2003 23:19:16 -0700 (PDT) Date: Sat, 6 Sep 2003 01:26:15 -0500 Subject: Re: [WishList] [Deployment] [EJB] Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) From: Dain Sundstrom To: geronimo-dev@incubator.apache.org Content-Transfer-Encoding: 7bit In-Reply-To: <3F593902.8000304@tackline.demon.co.uk> Message-Id: <04B95802-E033-11D7-B8F0-000393DB559A@coredevelopers.net> X-Mailer: Apple Mail (2.552) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Friday, September 5, 2003, at 08:31 PM, Thomas Hawtin wrote: > Dain Sundstrom wrote: >> On Thursday, September 4, 2003, at 02:01 AM, Sergei Batiuk wrote: >> That is not true. A normal Java method invocation on an Object >> reference (not an interface reference) takes about 3 nanoseconds on >> my 1g mac. A Java reflection invocation takes about 350 nanoseconds >> == 0.000 350 ms. My guess is you thing that is slow (and so do I). >> Instead of using Java reflection we will be using proxies generated >> by cglib which supports reflective style calls using a MethodProxy >> object. A reflection invocation using MethodProxy on my 1g mac takes >> 7 nanoseconds. > > I have some issues with your timings there. Are you using the client > HotSpot? I get for invocation only around 40 cycles with -server and > 440 with -client. For lookup and invocation I get 3,200 with -server > and 13,500 -client. Timings on a PII/266 running Linux and Sun JRE > 1.4.2, and obviously take microbenchmarks with a pinch of salt. Loops > with conventional virtual method invocations can be completely > optimised away. The idea is to get hot spot to optimize the loop so we only measure the cost of an invocation, but if you want to play with it I can send you the code. I really don't understand what you code does, but mine times somewhere 10,000 and 1,000,000 iterations. The number doesn't matter as long as it takes a while. For there I calculate the number of nanoseconds per operation. > Something to be wary of is start up times. IIRC, (server) HotSpot (and > I assume equivalent in other modern JREs) compile proxies for Method. > Obviously they don't necessarily have to go through byte code, so > start up times may be significantly faster. Startup time is really not a big concern in a long running server (within reason). We just need to be sure that all of the byte code generation happens during the deployment phase. > I'm not saying cglib decisions are wrong, just making sure they're > made with appropriate information... Agree. -dain /************************* * Dain Sundstrom * Partner * Core Developers Network *************************/