Author: bimargulies
Date: Mon Mar 17 18:36:35 2008
New Revision: 638167
URL: http://svn.apache.org/viewvc?rev=638167&view=rev
Log:
More experiments in jprofile profiling.
Added:
incubator/cxf/trunk/benchmark/profiling/
incubator/cxf/trunk/benchmark/profiling/build.xml (with props)
incubator/cxf/trunk/benchmark/profiling/src/
incubator/cxf/trunk/benchmark/profiling/src/main/
incubator/cxf/trunk/benchmark/profiling/src/main/java/
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/ClientEndpointCreationLoop.java
(with props)
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/DynamicClientEndpointCreationLoop.java
(with props)
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop.java
(with props)
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop2.java
(with props)
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop3.java
(with props)
Added: incubator/cxf/trunk/benchmark/profiling/build.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/benchmark/profiling/build.xml?rev=638167&view=auto
==============================================================================
--- incubator/cxf/trunk/benchmark/profiling/build.xml (added)
+++ incubator/cxf/trunk/benchmark/profiling/build.xml Mon Mar 17 18:36:35 2008
@@ -0,0 +1,168 @@
+<project name="CXF JProfile" default="run">
+
+ <property name="jprofile.home" location="/opt/jprofiler5"/>
+ <property name="cxf.dist"
location="../../distribution/target/apache-cxf-2.1-incubator-SNAPSHOT.dir/apache-cxf-2.1-incubator-SNAPSHOT"/>
+
+ <target name="setNativeLibDir" depends="setPlatform">
+ <property name="nativelib.dir"
location="${jprofile.home}/bin/${platform}"/>
+ </target>
+
+ <target name="setPlatform" unless="platform">
+ <condition property="platform" value="windows">
+ <os family="windows" arch="x86"/>
+ </condition>
+
+ <condition property="platform" value="windows-x64">
+ <os family="windows" arch="amd64"/>
+ </condition>
+
+ <condition property="platform" value="macos">
+ <os family="mac"/>
+ </condition>
+
+ <condition property="platform" value="linux-x86">
+ <os name="linux" arch="x86"/>
+ </condition>
+ <condition property="platform" value="linux-x64">
+ <os name="linux" arch="amd64"/>
+ </condition>
+
+ <condition property="platform" value="solaris-sparc">
+ <os name="sunos" arch="sparc"/>
+ </condition>
+ <condition property="platform" value="solaris-sparcv9">
+ <os name="sunos" arch="sparcv9"/>
+ </condition>
+ <condition property="platform" value="solaris-x86">
+ <os name="sunos" arch="x86"/>
+ </condition>
+ <condition property="platform" value="solaris-x64">
+ <os name="sunos" arch="x64"/>
+ </condition>
+
+ <condition property="platform" value="hpux-parisc">
+ <os name="hp-ux" arch="pa_risc2.0"/>
+ </condition>
+ <condition property="platform" value="hpux-parisc64">
+ <os name="hp-ux" arch="pa_risc2.0w"/>
+ </condition>
+
+ <condition property="platform" value="aix-ppc64">
+ <os name="aix" arch="ppc64"/>
+ </condition>
+ <condition property="platform" value="aix-ppc">
+ <os name="aix" arch="ppc"/>
+ </condition>
+
+ <fail unless="platform">Could not determine native library directory.
Please pass the -Dplatform=... property manually to this ant script.</fail>
+ </target>
+
+ <target name="setNativeLibEnvVar">
+
+ <property environment="env"/>
+
+ <condition property="nativelib.envvar" value="Path">
+ <and>
+ <os family="windows"/>
+ <isset property="env.Path"/>
+ </and>
+ </condition>
+
+ <condition property="nativelib.envvar" value="PATH">
+ <and>
+ <os family="windows"/>
+ <not>
+ <isset property="nativelib.envvar"/>
+ </not>
+ </and>
+ </condition>
+
+ <condition property="nativelib.envvar" value="DYLD_LIBRARY_PATH">
+ <os family="mac"/>
+ </condition>
+
+ <condition property="nativelib.envvar" value="SHLIB_PATH">
+ <os name="hp-ux"/>
+ </condition>
+
+ <condition property="nativelib.envvar" value="LIBPATH">
+ <os name="aix"/>
+ </condition>
+
+ <condition property="nativelib.envvar" value="LD_LIBRARY_PATH">
+ <not>
+ <isset property="nativelib.envvar"/>
+ </not>
+ </condition>
+
+ <setEnvvarValue varname="${nativelib.envvar}"/>
+
+ </target>
+
+ <macrodef name="setEnvvarValue">
+ <attribute name="varname"/>
+ <sequential>
+ <property environment="env"/>
+ <property name="nativelib.envvarValue" value="[EMAIL PROTECTED]"/>
+ </sequential>
+ </macrodef>
+
+ <target name="prepare">
+ <mkdir dir="bin"/>
+ </target>
+
+
+ <path id="compile-classpath">
+ <pathelement location="${jprofile.home}/bin/agent.jar"/>
+ <pathelement location="../../systests/target/classes"/>
+ <pathelement location="../../systests/target/test-classes"/>
+ <pathelement location="../../testutils/target/classes"/>
+ <fileset dir="${cxf.dist}/lib">
+ <include name="*.jar"/>
+ </fileset>
+ </path>
+
+ <path id="run-classpath">
+ <pathelement location="bin"/>
+ <pathelement location="../../systests/target/classes"/>
+ <pathelement location="../../systests/target/test-classes"/>
+ <pathelement location="../../testutils/target/classes"/>
+ <fileset dir="${cxf.dist}/lib">
+ <include name="*.jar"/>
+ </fileset>
+ </path>
+
+ <target name="compile" depends="prepare" description="Compile the offline
profiling sample">
+
+ <!-- The controller API classes are contained in agent.jar -->
+ <javac srcdir="src/main/java"
+ destdir="bin"
+ >
+ <classpath refid="compile-classpath"/>
+ </javac>
+
+ </target>
+
+ <target name="clean" description="Delete all compiled classes and saved
snapshot files">
+ <delete>
+ <fileset dir="bin">
+ <include name="src/**/*.class"/>
+ <include name="*.jps"/>
+ </fileset>
+ </delete>
+ </target>
+
+ <target name="run" depends="compile,setNativeLibDir" description="Run the
offline profiling sample">
+
+ <java classname="org.apache.cxf.profile.ClientEndpointCreationLoop"
fork="true">
+ <arg value="100"/>
+ <arg value="client_endpoint.jps"/>
+ <jvmarg
value="-agentlib:jprofilerti=offline,id=146,config=jprofileConfig.xml"></jvmarg>
+ <jvmarg
value="-Xbootclasspath/a:${jprofile.home}/bin/agent.jar"></jvmarg>
+ <env key="LD_LIBRARY_PATH"
path="${nativelib.dir}:${nativelib.envvarValue}"/>
+
+ <classpath refid="run-classpath"/>
+ </java>
+ </target>
+
+</project>
\ No newline at end of file
Propchange: incubator/cxf/trunk/benchmark/profiling/build.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/benchmark/profiling/build.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/benchmark/profiling/build.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added:
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/ClientEndpointCreationLoop.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/ClientEndpointCreationLoop.java?rev=638167&view=auto
==============================================================================
---
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/ClientEndpointCreationLoop.java
(added)
+++
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/ClientEndpointCreationLoop.java
Mon Mar 17 18:36:35 2008
@@ -0,0 +1,66 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.profile;
+
+import com.jprofiler.api.agent.Controller;
+
+import java.io.File;
+import java.net.URISyntaxException;
+
+import javax.xml.namespace.QName;
+
+import org.apache.hello_world_soap_http.Greeter;
+import org.apache.hello_world_soap_http.SOAPService;
+
+/**
+ *
+ */
+public final class ClientEndpointCreationLoop {
+
+ private final QName portName = new
QName("http://apache.org/hello_world_soap_http",
+ "SoapPort");
+
+ private ClientEndpointCreationLoop() {
+ }
+
+ private void iteration() throws URISyntaxException {
+ SOAPService service = new SOAPService();
+ service.getPort(portName, Greeter.class);
+ }
+ /**
+ * @param args
+ * @throws URISyntaxException
+ */
+ public static void main(String[] args) throws URISyntaxException {
+ Controller.stopAllocRecording();
+ Controller.stopCPURecording();
+ ClientEndpointCreationLoop ecl = new ClientEndpointCreationLoop();
+ ecl.iteration(); // warm up.
+ Controller.startCPURecording(true);
+ Controller.startAllocRecording(true);
+ int count = Integer.parseInt(args[0]);
+ for (int x = 0; x < count; x++) {
+ ecl.iteration();
+ }
+ Controller.stopAllocRecording();
+ Controller.stopCPURecording();
+ Controller.saveSnapshot(new File(args[1]));
+ }
+}
Propchange:
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/ClientEndpointCreationLoop.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/ClientEndpointCreationLoop.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/DynamicClientEndpointCreationLoop.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/DynamicClientEndpointCreationLoop.java?rev=638167&view=auto
==============================================================================
---
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/DynamicClientEndpointCreationLoop.java
(added)
+++
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/DynamicClientEndpointCreationLoop.java
Mon Mar 17 18:36:35 2008
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.profile;
+
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.CXFBusFactory;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.endpoint.dynamic.DynamicClientFactory;
+
+/**
+ *
+ */
+public final class DynamicClientEndpointCreationLoop {
+
+ private Bus bus;
+
+ private DynamicClientEndpointCreationLoop() {
+ CXFBusFactory busFactory = new CXFBusFactory();
+ bus = busFactory.createBus();
+ }
+
+ private void iteration() throws URISyntaxException {
+ URL wsdl =
getClass().getResource("/wsdl/others/dynamic_client_base64.wsdl");
+ String wsdlUrl = null;
+ wsdlUrl = wsdl.toURI().toString();
+ DynamicClientFactory dynamicClientFactory =
DynamicClientFactory.newInstance(bus);
+ Client client = dynamicClientFactory.createClient(wsdlUrl);
+ client.destroy();
+ }
+ /**
+ * @param args
+ * @throws URISyntaxException
+ */
+ public static void main(String[] args) throws URISyntaxException {
+ DynamicClientEndpointCreationLoop ecl = new
DynamicClientEndpointCreationLoop();
+ int count = Integer.parseInt(args[0]);
+ for (int x = 0; x < count; x++) {
+ ecl.iteration();
+ }
+ }
+}
Propchange:
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/DynamicClientEndpointCreationLoop.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/DynamicClientEndpointCreationLoop.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop.java?rev=638167&view=auto
==============================================================================
---
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop.java
(added)
+++
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop.java
Mon Mar 17 18:36:35 2008
@@ -0,0 +1,59 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.profile;
+
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+
+/**
+ *
+ */
+public final class EndpointCreationLoop {
+
+ private GenericApplicationContext applicationContext;
+
+ private EndpointCreationLoop() {
+ }
+
+ private void readBeans(Resource beanResource) {
+ XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(
+ applicationContext);
+ reader.loadBeanDefinitions(beanResource);
+ }
+
+ private void iteration() {
+ applicationContext = new GenericApplicationContext();
+ readBeans(new ClassPathResource("extrajaxbclass.xml"));
+ applicationContext.refresh();
+ applicationContext.close();
+ }
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ EndpointCreationLoop ecl = new EndpointCreationLoop();
+ int count = Integer.parseInt(args[0]);
+ for (int x = 0; x < count; x++) {
+ ecl.iteration();
+ }
+ }
+}
Propchange:
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop2.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop2.java?rev=638167&view=auto
==============================================================================
---
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop2.java
(added)
+++
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop2.java
Mon Mar 17 18:36:35 2008
@@ -0,0 +1,70 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.profile;
+
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+
+/**
+ *
+ */
+public final class EndpointCreationLoop2 {
+
+ private GenericApplicationContext applicationContext;
+
+ private EndpointCreationLoop2() {
+ }
+
+ private void readBeans(Resource beanResource) {
+ XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(
+ applicationContext);
+ reader.loadBeanDefinitions(beanResource);
+ }
+
+ private void init() {
+ applicationContext = new GenericApplicationContext();
+ readBeans(new ClassPathResource("extrajaxbclass.xml"));
+ applicationContext.refresh();
+ }
+
+ private void close() {
+ applicationContext.close();
+ }
+
+ private void iteration() {
+ applicationContext.stop();
+ applicationContext.start();
+
+ }
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ EndpointCreationLoop2 ecl = new EndpointCreationLoop2();
+ ecl.init();
+ int count = Integer.parseInt(args[0]);
+ for (int x = 0; x < count; x++) {
+ ecl.iteration();
+ }
+ ecl.close();
+ }
+}
Propchange:
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop2.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop2.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop3.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop3.java?rev=638167&view=auto
==============================================================================
---
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop3.java
(added)
+++
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop3.java
Mon Mar 17 18:36:35 2008
@@ -0,0 +1,54 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.profile;
+
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+
+/**
+ *
+ */
+public final class EndpointCreationLoop3 {
+
+
+ private EndpointCreationLoop3() {
+ }
+
+ private void iteration() {
+ JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
+ sf.setAddress("http://localhost:9000/test");
+
sf.setServiceClass(org.apache.cxf.systest.jaxb.service.TestServiceImpl.class);
+ sf.setStart(false);
+
+ Server server = sf.create();
+ server.start();
+ server.stop();
+ }
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ EndpointCreationLoop3 ecl = new EndpointCreationLoop3();
+ int count = Integer.parseInt(args[0]);
+ for (int x = 0; x < count; x++) {
+ ecl.iteration();
+ }
+ }
+}
Propchange:
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop3.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/benchmark/profiling/src/main/java/org/apache/cxf/profile/EndpointCreationLoop3.java
------------------------------------------------------------------------------
svn:keywords = Rev Date