Skip to content

Instantly share code, notes, and snippets.

@mnem
Created March 16, 2010 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mnem/333822 to your computer and use it in GitHub Desktop.
Save mnem/333822 to your computer and use it in GitHub Desktop.
public function speedTestA() :void
{
var a :int = 1;
var b :int = 2;
b = a + a + a;
}
public function speedTestB() :void
{
var a :int = 1;
var b :int = 2;
b = a + a;
b += a;
}
// Bytecode for the above functions:
//
// function performancetests:Test:::speedTestA()::void
// maxStack:2 localCount:3 initScopeDepth:4 maxScopeDepth:5
// getlocal0
// pushscope
// pushbyte 1
// setlocal1
// pushbyte 2
// setlocal2
// getlocal1
// getlocal1
// add
// getlocal1
// add
// convert_i
// setlocal2
// returnvoid
// 0 Extras
// 0 Traits Entries
//
// function performancetests:Test:::speedTestB()::void
// maxStack:2 localCount:3 initScopeDepth:4 maxScopeDepth:5
// getlocal0
// pushscope
// pushbyte 1
// setlocal1
// pushbyte 2
// setlocal2
// getlocal1
// getlocal1
// add
// convert_i
// setlocal2
// getlocal2
// getlocal1
// add
// convert_i
// setlocal2
// returnvoid
// 0 Extras
// 0 Traits Entries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment