OK
I guess we never publicly put these numbers out before but in a typical invocation this is what goes on. >From web layer to ejb container to be and back (tomcat-test.ear). total invocation with integrated (UCL) stack 0.04 ms per invocation (top to bottom) on a 1.4 Ghz linux 500m ram if we don't optimize (no UCL and we marshal) then the time goes to 0.35ms per invocation of which 0.04 are spent in the container. meaning the whole time done in serialization (!!!!) this doesn't do DB but DB is the same... serialization. Serialization is expensive. The container time is NOTHING.... do you know why IBM with a crappy websphere can ECPerf the hell out of Borland? because the time is in serialization with DB and the bottom line is that a tuned DB2 on a big box will kick everyone else. ECPerf' dirty little secret is that it is a DB bench, oh no excuse me "a complete solution bench", right... a db bench. Ok back to our story. So when everything is peachy the time can be 0.04ms for the whole container (including transactions/security/cache/pools etc) that is 40,000 nanoseconds for a container invocation. if we use the old ObjectName of this morning then the time was 0.11ms almost doubling the time it takes for an invocation, essentially doubling the containers time. Still dog shit compared to all the serialization but still. Blame SUN's JMX RI. So the string vs switch is still taking about 70ms for .5M invocation 70e-3x2xe-6 =140 nanoseconds per switch operation. 140 nanoseconds... I am wasting my time trying to optimize 140 nanoseconds versus 900 nanoseconds... I am peeing on myself here. It doesn't matter the container takes 40,000 of them, the serialization (RMI/SOAP) takes 400,000 of them. and I am fighting a meager 1000? So I am making a 2% difference woohoo on pure container speed. I am making a 0.2% difference when you include serialization (no UCL), and I am peeing my pants when you add CMP 2.0 persistence that takes your time to a wonderful 4s per invocation. ah databases, and we wonder why SUN's historical ally has been Oracle... well actually since I am still up at 2am staring at these silly numbers I might as well code, ECPerf has eaten my brains... I will optimize my container and let those gains disapear in your Option B settings you cretins... if it rhymes it's a haiku! marcf |-----Original Message----- |From: [EMAIL PROTECTED] |[mailto:[EMAIL PROTECTED]]On Behalf Of |Dmitri Colebatch |Sent: Wednesday, February 06, 2002 10:35 PM |To: marc fleury; [EMAIL PROTECTED] |Subject: Re: RE: RE: [JBoss-dev] something is broken... | | |I have no idea if my test is ok, but I've got string being 3 1/2 |times slower than switch.. thats not taking into account the cost |of figuring out an int value for the stirng of course. | |test: | |public class EqualsVsSwitch |{ | public static final int FOO_AS_INT = 0; | public static final int BAR_AS_INT = 1; | public static final int ABC_AS_INT = 2; | public static final int DEF_AS_INT = 3; | | public static final String FOO = "foo"; | public static final String BAR = "bar"; | public static final String ABC = "abc"; | public static final String DEF = "def"; | | public static final String[] strings = new String[] { FOO, |BAR, ABC, DEF }; | | long testEquals(int repeat) | { | long start = System.currentTimeMillis(); | int idx = 0; | for (int i=0; i<repeat; i++) | { | String var = strings[idx]; | if (var.equals(FOO)) | { | } | else if (var.equals(BAR)) | { | } | else if (var.equals(ABC)) | { | } | else if (var.equals(DEF)) | { | } | if (++idx > 3) idx = 0; | } | long end = System.currentTimeMillis(); | return end - start; | } | | long testSwitch(int repeat) | { | long start = System.currentTimeMillis(); | int idx = 0; | for (int i=0; i<repeat; i++) | { | // here to ensure the same stuff gets done | // - does the compiler take it out tho? | String var = strings[idx]; | switch (idx) | { | case FOO_AS_INT: | break; | case BAR_AS_INT: | break; | case ABC_AS_INT: | break; | case DEF_AS_INT: | break; | } | if (++idx > 3) idx = 0; | } | long end = System.currentTimeMillis(); | return end - start; | } | | public static final int LOOPS = 500000; | | public static void main(String[] args) | { | EqualsVsSwitch test = new EqualsVsSwitch(); | | long totalEqual = test.testEquals(LOOPS); | long totalSwitch = test.testSwitch(LOOPS); | | System.out.println("Equal: " + totalEqual); | System.out.println("Switch: " + totalSwitch); | } |} | |and results: | |Equal: 70 |Switch: 10 | |cheesr |dim | | |----- Original Message ----- |From: "marc fleury" <[EMAIL PROTECTED]> |To: "marc fleury" <[EMAIL PROTECTED]>; |<[EMAIL PROTECTED]> |Sent: Thursday, February 07, 2002 8:05 PM |Subject: RE: RE: RE: [JBoss-dev] something is broken... | | |> Ok webinf done, my eyes are tired |> |> I will look briefly at the EC fix for switch instead of Sring |> manipulation... |> |> anyone knows the time it takes for either one? |> |> marcf |> |> |-----Original Message----- |> |From: [EMAIL PROTECTED] |> |[mailto:[EMAIL PROTECTED]]On Behalf Of marc |> |fleury |> |Sent: Wednesday, February 06, 2002 11:50 PM |> |To: [EMAIL PROTECTED] |> |Subject: RE: RE: RE: [JBoss-dev] something is broken... |> | |> | |> |following our little conversation with Jason, I understand the |problem and |> |it is indeed me, i forgot to adapt the new entitycontainer to |the new "int" |> |based switch as opposed to string manipulation. |> | |> |will fix in the coming hours, fuck I need to fly tomorrow.... |> | |> |Also I am almost done with the webinf/classes fix. |> | |> |and then bill and scott get to breeze and roam free, I am gone for |> |a fucking |> |10 days and you guys get to not have me break cvs every hours or so... |> | |> |Here is a promise, if you guys bring the errors to zero I |promise to ALWAYS |> |run the testsuite everytime I commit a line of comment, that will be my |> |penitence. |> | |> |maybe |> | |> ||-----Original Message----- |> ||From: [EMAIL PROTECTED] |> ||[mailto:[EMAIL PROTECTED]]On |Behalf Of Jason |> ||Dillon |> ||Sent: Wednesday, February 06, 2002 8:21 PM |> ||To: [EMAIL PROTECTED] |> ||Subject: Re: RE: RE: [JBoss-dev] something is broken... |> || |> || |> ||What is the operation that invoke is supposed to call? I guess |> ||there is just one now... looking it up from cvslogs (but if you |> ||could tell me it would be easier). |> || |> ||--jason |> || |> ||_________________________________________________________ |> ||View thread online: http://main.jboss.org/thread.jsp?forum=66&thread=7990 > || > ||_______________________________________________ > ||Jboss-development mailing list > ||[EMAIL PROTECTED] > ||https://lists.sourceforge.net/lists/listinfo/jboss-development > | > | > |_______________________________________________ > |Jboss-development mailing list > |[EMAIL PROTECTED] > |https://lists.sourceforge.net/lists/listinfo/jboss-development > > > _______________________________________________ > Jboss-development mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-development _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
