performance-tuning-$3.lzx

<canvas height="150" width="100%">
    <include href="utils/performance"/>
    <script>
      var iterations = Measurement.defaultIterations;
      var j;
      function empty () {
        for (var i = 0; i < iterations; i++) {
         j = i;
        }
      }
      
      function globalReference () {
        for (var i = 0; i < iterations; i++) {
          j = Math.PI;
        }
      }

      function cachedGlobalReference() {
        var PI = Math.PI;
        for (var i = 0; i < iterations; i++) {
          j = PI;
        }
      } 

      (new Measurement({'Global reference': globalReference,
                      'Cached global reference': cachedGlobalReference,
                      'empty': empty})).run();
    </script>
  </canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2007, 2008 Laszlo Systems, Inc.  All Rights Reserved.                   *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->

Cross References

Includes