Small Footprint

A few changes can be made to reduce the footprint of Rhino for embeddings where space is at a premium. On a recent build, Rhino consumed 355,883 bytes of space for uncompressed class files. With various changes that number can be reduced to 281,455 bytes.
 

Tools

Most embeddings won't need any of the classes in org.mozilla.javascript.tools or any of its subpackages.
 

Regular Expressions

The package org.mozilla.javascript.regexp can be removed. Rhino will continue to run, although it will not be able to execute any regular expression matches. This change saves 37,792 bytes of class files.
 

JavaAdapter

Implementing the JavaAdapter functionality requires the ability to generate classes on the fly. Removing org.mozilla.javascript.JavaAdapter and all the classes in package org.mozilla.classfile will disable this functionality, but Rhino will otherwise run correctly. These changes save 36,636 bytes.
 

Optimizer

It is possible to run Rhino with interpreter mode only, allowing you to remove classes for classfile generation. Remove the classes in packages org.mozilla.classfile and org.mozilla.javascript.optimizer.
 



back to top