harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiao-Feng Li" <xiaofeng...@gmail.com>
Subject Re: [vm] Implement on-demand class library parsing to avoid unnecessary jar/zip parsing during startup (HARMONY-6039)
Date Wed, 10 Dec 2008 12:50:24 GMT
On Wed, Dec 10, 2008 at 6:50 PM, Tim Ellison <t.p.ellison@gmail.com> wrote:
> This is cool.
>
> Wenlong Li (JIRA) wrote:
>> During VM creation, Harmony will parse all class libraried defined in
>> bootclasspath.properties under jre/lib/boot directory. However, not
>> all class libraries are accessed during startup. That means, it is
>> not necessary to open and resolve all these class libraries.
>
> Agreed.
>
>> In this patch, I implement the on-demand jar parsing. I leverage the
>> class library info defined in the manifest file of each module. For a
>> request class, if it is not available in existing class table, I then
>> parse its class library info, and check which module contains this
>> requested class. That is, I parse the class library on demand.
>
> Its good to see the manifest information being used at runtime.
>
> So as I understand it, you are not looking to provide any isolation
> between modules, just using the metadata to direct the search path.
>
>> Using on-demand class library parsing, I can reduce the VM creation
>> time from 20+ seconds to 3 seconds.
>
> Wow, that's remarkable.  Is ZIP file directory performance really that bad?
>
> I'm assuming that it is multiple VM creations (it doesn't take 20s to
> invoke the VM usually!)  And that is still opening and reading the
> manifest from each JAR?

Cold start (first time launch) and warm start (not first time launch)
have very different numbers, because of the disk access caching
effect. The numbers in seconds should be cold start. I remember in
Wenlong's data given early, this work can improve the warm start time
as well, something like from 170ms to 140ms.

> I assume we could improve that by consolidating that metadata into a
> file with faster access.

Yes, below is what Wenlong's patch includes.

+# The modulelibrarymapping properties show class libraries in each module.
+#
+# Upon class request, the VM checks which module contains this class
library, and then
+# open the module to read all classes within this element.
+# The on-demand class library parsing is enabled for fast application
startup by reducing
+# the number of class libraries loaded during startup, which
minimizes unnecessary I/O operations.
+#
+# The launcher option -Xbootclasspath overrides this features.
+#
+
+accessibility.jar=javax.accessibility
+applet.jar=java.applet
+auth.jar=javax.security.auth,javax.security.auth.callback,javax.security.auth.kerberos,javax.security.auth.login,javax.security.auth.spi,javax.security.auth.x500,javax.security.sasl,org.ietf.jgss
+awt.jar=java.awt,java.awt.color,java.awt.datatransfer,java.awt.dnd,java.awt.dnd.peer,java.awt.event,java.awt.font,java.awt.geom,java.awt.im,java.awt.im.spi,java.awt.image,java.awt.image.renderable,java.awt.peer,java.awt.print,org.apache.harmony.awt,org.apache.harmony.awt.gl,org.apache.harmony.awt.gl.image,org.apache.harmony.awt.gl.windows,org.apache.harmony.awt.nativebridge,org.apache.harmony.awt.nativebridge.windows,org.apache.harmony.awt.text
+beans.jar=java.beans,java.beans.beancontext
+crypto.jar=javax.crypto,javax.crypto.interfaces,javax.crypto.spec
+imageio.jar=javax.imageio
+instrument.jar=java.lang.instrument
+jndi.jar=javax.naming,javax.naming.directory,javax.naming.event,javax.naming.ldap,javax.naming.spi
+lang-management.jar=java.lang.management
+logging.jar=java.util.logging
+math.jar=java.math
+prefs.jar=java.util.prefs
+print.jar=javax.print,javax.print.attribute,javax.print.attribute.standard,javax.print.event,org.apache.harmony.x.print
+regex.jar=java.util.regex
+rmi.jar=java.rmi,java.rmi.activation,java.rmi.dgc,java.rmi.registry,java.rmi.server,javax.activity,org.apache.harmony.rmi.transport
+sound.jar=javax.sound.midi,javax.sound.midi.spi
+sql.jar=java.sql,javax.sql,javax.sql.rowset,javax.sql.rowset.spi,javax.transaction,javax.transaction.xa
+swing.jar=javax.swing,javax.swing.border,javax.swing.colorchooser,javax.swing.event,javax.swing.filechooser,javax.swing.plaf,javax.swing.plaf.basic,javax.swing.plaf.metal,javax.swing.table,javax.swing.text,javax.swing.text.html,javax.swing.text.html.parser,javax.swing.tree,javax.swing.undo
+text.jar=java.text
+x-net.jar=javax.net,javax.net.ssl,org.apache.harmony.xnet.provider.jsse
+icu4j_3.8\\icu4j-charsets-3_8.jar=com.ibm.icu.lang,com.ibm.icu.math,com.ibm.icu.text,com.ibm.icu.util,com.ibm.icu.charset
+xalan-j_2.7.0\\xalan.jar=org.apache.xpath,org.apache.xpath.objects
+xerces_2.9.1\\resolver.jar=org.apache.env,org.apache.xml.resolver
+xerces_2.9.1\\xercesImpl.jar=org.apache.xerces.impl,org.xml.sax,org.w3c.dom,org.w3c.dom.ls,javax.xml.datatype,javax.xml.parsers,,javax.xml.transform,javax.xml.validation.javax.xml.xpath.org.apache.xerces.xni
+xerces_2.9.1\\xml-apis.jar=org.apache.xmlcommons.Version,org.xml.sax,org.w3c.dom,org.w3c.dom.ls,javax.xml.parsers,javax.xml.transform,javax.xml.validation,javax.xml.datatype,javax.xml.xpath
+mx4j_3.0.2\\mx4j.jar=javax.management,javax.management.loading,javax.management.modelmbean,javax.management.monitor,javax.management.openmbean,javax.management.relation,javax.management.timer
+mx4j_3.0.2\\mx4j-remote.jar=javax.management,javax.management.loading,javax.management.modelmbean,javax.management.monitor,javax.management.openmbean,javax.management.relation,javax.management.timer
+yoko-1.0-SNAPSHOT-20080304\\yoko.jar=org.omg
+yoko-1.0-SNAPSHOT-20080304\\yoko-core.jar=org.apache.yoko.orb
+yoko-1.0-SNAPSHOT-20080304\\yoko-rmi-spec.jar=org.apache.yoko.rmispec.util
+yoko-1.0-SNAPSHOT-20080304\\yoko-rmi-impl.jar=org.apache.yoko.rmi
+bcel-5.2\\bcel-5.2.jar=org.apache.bcel
+pack200.jar=org.apache.harmony.pack200,org.apache.harmony.unpack200,org.apache.harmony.unpack200.bytecode,org.apache.harmony.unpack200.bytecode.forms
+misc.jar=org.apache.harmony.misc,org.apache.harmony.misc.accessors

Thanks,
xiaofeng

>> I enable this feature into reading boot class path option, and it can
>> be disabled by using -Xbootclasspath option.
>
> Regards,
> Tim
>



-- 
http://xiao-feng.blogspot.com

Mime
View raw message